aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-generic/gpio.h6
-rw-r--r--include/linux/gpio.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index ff5c66080c8c..a98b52cb970b 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -35,9 +35,9 @@
35 * platform data and other tables. 35 * platform data and other tables.
36 */ 36 */
37 37
38static inline int gpio_is_valid(int number) 38static inline bool gpio_is_valid(int number)
39{ 39{
40 return ((unsigned)number) < ARCH_NR_GPIOS; 40 return number >= 0 && number < ARCH_NR_GPIOS;
41} 41}
42 42
43struct device; 43struct device;
@@ -212,7 +212,7 @@ extern void gpio_unexport(unsigned gpio);
212 212
213#else /* !CONFIG_GPIOLIB */ 213#else /* !CONFIG_GPIOLIB */
214 214
215static inline int gpio_is_valid(int number) 215static inline bool gpio_is_valid(int number)
216{ 216{
217 /* only non-negative numbers are valid */ 217 /* only non-negative numbers are valid */
218 return number >= 0; 218 return number >= 0;
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 32720baf70f1..0f8265f8e8c3 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -25,9 +25,9 @@ struct gpio_chip;
25 * warning when something is wrongly called. 25 * warning when something is wrongly called.
26 */ 26 */
27 27
28static inline int gpio_is_valid(int number) 28static inline bool gpio_is_valid(int number)
29{ 29{
30 return 0; 30 return false;
31} 31}
32 32
33static inline int gpio_request(unsigned gpio, const char *label) 33static inline int gpio_request(unsigned gpio, const char *label)