gpiolib: Get rid of never false gpio_is_valid() calls
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 21 Feb 2024 21:31:56 +0000 (23:31 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 17 Apr 2024 20:46:44 +0000 (22:46 +0200)
commit8a7a6103258715857310253ec2193bcc4d1d7082
tree2d4eb722e036e87b3a313b525d5dbc4f82d2d612
parent8d1e84ab0176c2d2b49fd741d6609a021ecc1d01
gpiolib: Get rid of never false gpio_is_valid() calls

In the cases when gpio_is_valid() is called with unsigned parameter
the result is always true in the GPIO library code, hence the check
for false won't ever be true. Get rid of such calls.

While at it, move GPIO device base to be unsigned to clearly show
it won't ever be negative. This requires a new definition for the
maximum GPIO number in the system.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-legacy.c
drivers/gpio/gpiolib-sysfs.c
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.h
include/linux/gpio.h