[lantiq]
[openwrt.git] / target / linux / lantiq / patches-3.0 / 205-owrt-gpio-export.patch
1 Index: linux-3.0.3/drivers/gpio/gpiolib.c
2 ===================================================================
3 --- linux-3.0.3.orig/drivers/gpio/gpiolib.c     2011-10-03 00:13:35.359561120 +0200
4 +++ linux-3.0.3/drivers/gpio/gpiolib.c  2011-10-03 09:52:55.785047081 +0200
5 @@ -64,9 +64,9 @@
6  #define GPIO_FLAGS_MASK                ((1 << ID_SHIFT) - 1)
7  #define GPIO_TRIGGER_MASK      (BIT(FLAG_TRIG_FALL) | BIT(FLAG_TRIG_RISE))
8  
9 -#ifdef CONFIG_DEBUG_FS
10 +//#ifdef CONFIG_DEBUG_FS
11         const char              *label;
12 -#endif
13 +//#endif
14  };
15  static struct gpio_desc gpio_desc[ARCH_NR_GPIOS];
16  
17 @@ -76,9 +76,9 @@
18  
19  static inline void desc_set_label(struct gpio_desc *d, const char *label)
20  {
21 -#ifdef CONFIG_DEBUG_FS
22 +//#ifdef CONFIG_DEBUG_FS
23         d->label = label;
24 -#endif
25 +//#endif
26  }
27  
28  /* Warn when drivers omit gpio_request() calls -- legal but ill-advised
29 @@ -727,7 +727,8 @@
30  
31         if (desc->chip->names && desc->chip->names[gpio - desc->chip->base])
32                 ioname = desc->chip->names[gpio - desc->chip->base];
33 -
34 +       else
35 +               ioname = gpio_desc[gpio].label;
36         if (status == 0) {
37                 struct device   *dev;
38  
39 @@ -1347,11 +1348,11 @@
40                 return NULL;
41         if (test_bit(FLAG_REQUESTED, &gpio_desc[gpio].flags) == 0)
42                 return NULL;
43 -#ifdef CONFIG_DEBUG_FS
44 +//#ifdef CONFIG_DEBUG_FS
45         return gpio_desc[gpio].label;
46 -#else
47 -       return "?";
48 -#endif
49 +//#else
50 +//     return "?";
51 +//#endif
52  }
53  EXPORT_SYMBOL_GPL(gpiochip_is_requested);
54