summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-21 22:31:56 +0100
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-04-17 22:46:44 +0200
commit8a7a6103258715857310253ec2193bcc4d1d7082 (patch)
tree2d4eb722e036e87b3a313b525d5dbc4f82d2d612 /drivers/gpio/gpiolib.h
parentgpio: regmap: Use -ENOTSUPP consistently (diff)
downloadlinux-8a7a6103258715857310253ec2193bcc4d1d7082.tar.xz
linux-8a7a6103258715857310253ec2193bcc4d1d7082.zip
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>
Diffstat (limited to 'drivers/gpio/gpiolib.h')
-rw-r--r--drivers/gpio/gpiolib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index f67d5991ab1c..7f94580efdbc 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -61,7 +61,7 @@ struct gpio_device {
struct module *owner;
struct gpio_chip __rcu *chip;
struct gpio_desc *descs;
- int base;
+ unsigned int base;
u16 ngpio;
bool can_sleep;
const char *label;