> HI,
>
> do as in linux
>
> introduce
>
> static struct gpio_desc *gpio_to_desc(unsigned gpio)
>
> and we need to check the gpio is valid before calling _free/ser/get
> etc..
Indeed.
> > Signed-off-by: Alexander Shiyan
> > ---
> > drivers/gpio/gpiolib.c | 181
HI,
do as in linux
introduce
static struct gpio_desc *gpio_to_desc(unsigned gpio)
and we need to check the gpio is valid before calling _free/ser/get
etc..
On 11:27 Fri 10 May , Alexander Shiyan wrote:
>
> Signed-off-by: Alexander Shiyan
> ---
> d
no the current code is more clean
just move
gi = &gpio_desc[gpio];
chip = gi->chip
after the current check;
On 11:27 Fri 10 May , Alexander Shiyan wrote:
>
> Signed-off-by: Alexander Shiyan
> ---
> drivers/gpio/gpiolib.c | 181
> ++---
> 1 fil
Signed-off-by: Alexander Shiyan
---
drivers/gpio/gpiolib.c | 181 ++---
1 file changed, 95 insertions(+), 86 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 6398268..1662dcd 100644
--- a/drivers/gpio/gpiolib.c
+++ b/dri