Root/target/linux/lantiq/patches-3.3/0023-owrt-gpio-export.patch

1From 2489fa75bfd3bd196b862b497c41744aca34f851 Mon Sep 17 00:00:00 2001
2From: John Crispin <blogic@openwrt.org>
3Date: Fri, 3 Aug 2012 10:29:10 +0200
4Subject: [PATCH 23/25] owrt gpio export
5
6---
7 drivers/gpio/gpiolib.c | 17 ++++++++---------
8 1 files changed, 8 insertions(+), 9 deletions(-)
9
10diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
11index 17fdf4b..7b8d336 100644
12--- a/drivers/gpio/gpiolib.c
13+++ b/drivers/gpio/gpiolib.c
14@@ -64,9 +64,9 @@ struct gpio_desc {
15 #define GPIO_FLAGS_MASK ((1 << ID_SHIFT) - 1)
16 #define GPIO_TRIGGER_MASK (BIT(FLAG_TRIG_FALL) | BIT(FLAG_TRIG_RISE))
17 
18-#ifdef CONFIG_DEBUG_FS
19+//#ifdef CONFIG_DEBUG_FS
20     const char *label;
21-#endif
22+//#endif
23 };
24 static struct gpio_desc gpio_desc[ARCH_NR_GPIOS];
25 
26@@ -76,9 +76,9 @@ static DEFINE_IDR(dirent_idr);
27 
28 static inline void desc_set_label(struct gpio_desc *d, const char *label)
29 {
30-#ifdef CONFIG_DEBUG_FS
31+//#ifdef CONFIG_DEBUG_FS
32     d->label = label;
33-#endif
34+//#endif
35 }
36 
37 /* Warn when drivers omit gpio_request() calls -- legal but ill-advised
38@@ -727,7 +727,6 @@ int gpio_export(unsigned gpio, bool direction_may_change)
39 
40     if (desc->chip->names && desc->chip->names[gpio - desc->chip->base])
41         ioname = desc->chip->names[gpio - desc->chip->base];
42-
43     if (status == 0) {
44         struct device *dev;
45 
46@@ -1351,11 +1350,11 @@ const char *gpiochip_is_requested(struct gpio_chip *chip, unsigned offset)
47         return NULL;
48     if (test_bit(FLAG_REQUESTED, &gpio_desc[gpio].flags) == 0)
49         return NULL;
50-#ifdef CONFIG_DEBUG_FS
51+//#ifdef CONFIG_DEBUG_FS
52     return gpio_desc[gpio].label;
53-#else
54- return "?";
55-#endif
56+//#else
57+// return "?";
58+//#endif
59 }
60 EXPORT_SYMBOL_GPL(gpiochip_is_requested);
61 
62--
631.7.9.1
64
65

Archive Download this file



interactive