uClibc for x86 targets and kernels >= 2.6.24 need to copy the right include files...
[openwrt-10.03/.git] / target / linux / generic-2.6 / patches-2.6.25 / 920-backport-gpio-is-valid.patch
1 Backport gpio_is_valid() for gpiolib from linux-2.6.26
2 Index: linux-2.6.25.10/include/asm-generic/gpio.h
3 ===================================================================
4 --- linux-2.6.25.10.orig/include/asm-generic/gpio.h     2008-07-03 05:46:47.000000000 +0200
5 +++ linux-2.6.25.10/include/asm-generic/gpio.h  2008-07-20 20:32:12.000000000 +0200
6 @@ -16,6 +16,12 @@
7  #define ARCH_NR_GPIOS          256
8  #endif
9  
10 +static inline int gpio_is_valid(int number)
11 +{
12 +       /* only some non-negative numbers are valid */
13 +       return ((unsigned)number) < ARCH_NR_GPIOS;
14 +}
15 +
16  struct seq_file;
17  
18  /**