aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-28 13:56:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-28 13:56:34 -0400
commit04830fccdcafa7e0ea913990ae56437253553fef (patch)
tree16d423628a516f544a0e5bb8fd4f00d88a55395f /include/asm-generic
parent571503e10045c89af951962ea0bb783482663aad (diff)
parent1486a7409b42ec434be310e091ef68660a2f6cd0 (diff)
Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6
* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6: gpio/pch_gpio: Support new device ML7223 gpio: make gpio_{request,free}_array gpio array parameter const GPIO: OMAP: move to drivers/gpio GPIO: OMAP: move register offset defines into <plat/gpio.h> gpio: Convert gpio_is_valid to return bool gpio: Move the s5pc100 GPIO to drivers/gpio gpio: Move the s5pv210 GPIO to drivers/gpio gpio: Move the exynos4 GPIO to drivers/gpio gpio: Move to Samsung common GPIO library to drivers/gpio gpio/nomadik: add function to read GPIO pull down status gpio/nomadik: show all pins in debug gpio: move Nomadik GPIO driver to drivers/gpio gpio: move U300 GPIO driver to drivers/gpio langwell_gpio: add runtime pm support gpio/pca953x: Add support for pca9574 and pca9575 devices gpio/cs5535: Show explicit dependency between gpio_cs5535 and mfd_cs5535
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/gpio.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index ff5c66080c8c..fcdcb5d5c995 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;
@@ -193,8 +193,8 @@ struct gpio {
193}; 193};
194 194
195extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); 195extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
196extern int gpio_request_array(struct gpio *array, size_t num); 196extern int gpio_request_array(const struct gpio *array, size_t num);
197extern void gpio_free_array(struct gpio *array, size_t num); 197extern void gpio_free_array(const struct gpio *array, size_t num);
198 198
199#ifdef CONFIG_GPIO_SYSFS 199#ifdef CONFIG_GPIO_SYSFS
200 200
@@ -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;