aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
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')
-rw-r--r--include/asm-generic/gpio.h10
-rw-r--r--include/linux/gpio.h8
2 files changed, 9 insertions, 9 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index ff5c66080c8..fcdcb5d5c99 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;
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 32720baf70f..32d47e71066 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)
@@ -41,7 +41,7 @@ static inline int gpio_request_one(unsigned gpio,
41 return -ENOSYS; 41 return -ENOSYS;
42} 42}
43 43
44static inline int gpio_request_array(struct gpio *array, size_t num) 44static inline int gpio_request_array(const struct gpio *array, size_t num)
45{ 45{
46 return -ENOSYS; 46 return -ENOSYS;
47} 47}
@@ -54,7 +54,7 @@ static inline void gpio_free(unsigned gpio)
54 WARN_ON(1); 54 WARN_ON(1);
55} 55}
56 56
57static inline void gpio_free_array(struct gpio *array, size_t num) 57static inline void gpio_free_array(const struct gpio *array, size_t num)
58{ 58{
59 might_sleep(); 59 might_sleep();
60 60