gpiolib: use gpiochip_get_desc() where applicable
PATCH 1/1 gpiolib: use gpiochip_get_desc() where applicable
From: Bartosz Golaszewski <[email protected]>
Whenever retrieving a descriptor from a gpiochip: use the provided helper which checks for errors.
Signed-off-by Bartosz Golaszewski <[email protected]>
--- drivers/gpio/gpiolib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +3 -1
@@ -2953,7 +2953,9 @@ const char *gpiochip_is_requested(struct gpio_chip *chip, unsigned offset)if (offset >= chip->ngpio)return NULL ; - desc = &chip->gpiodev->descs[offset]; + desc =gpiochip_get_desc (chip, offset); +if (IS_ERR (desc)) +return NULL ;if (test_bit (FLAG_REQUESTED , &desc->flags) ==0 )return NULL ;
Signature · 1 line
2.25.0
Quoted 6 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Whenever retrieving a descriptor from a gpiochip: use the provided helper which checks for errors.
Signed-off-by Bartosz Golaszewski <[email protected]>
Patch applied!
Yours,
Linus Walleij