OSDN Git Service

gpiolib: Simplify error path in gpiod_get_index() when requesting GPIO
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 1 Feb 2022 15:27:58 +0000 (17:27 +0200)
committerBartosz Golaszewski <brgl@bgdev.pl>
Tue, 8 Feb 2022 09:36:11 +0000 (10:36 +0100)
commit6105b2e391879df0ebee20c764bbdd406cb74fb2
tree30fc87a5d84adbe9ec5fb2b7c3d884c4229deb29
parent322b86e7a73042300303844c9bc51bf6995a47ef
gpiolib: Simplify error path in gpiod_get_index() when requesting GPIO

Simplify error path in the gpiod_get_index() when requesting a GPIO line by:
 - checking for error condition first
 - dropping redundant 'else'

As a result, decrease the indentation level for better readability.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpiolib.c