aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2014-03-10 08:54:52 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-03-13 10:14:48 -0400
commit4b01a14bac73352a9c7d7850ea4111fcb0c0a5bf (patch)
tree2d61d95eaabdbe0cfd952840e5abec8ab5c43974 /drivers/gpio
parentaa92b6f689acf159120ce0753f36100c3b190b4d (diff)
gpio / ACPI: Rename acpi_gpio_evt_pin to acpi_gpio_event
In order to consolidate _Exx, _Lxx and _EVT to use the same structure make the structure name to reflect that we are dealing with any event, not just _EVT. This is just rename, no functional changes. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-acpi.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 5c0cf1d76c8b..be09e7526890 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -19,16 +19,16 @@
19 19
20#include "gpiolib.h" 20#include "gpiolib.h"
21 21
22struct acpi_gpio_evt_pin { 22struct acpi_gpio_event {
23 struct list_head node; 23 struct list_head node;
24 acpi_handle *evt_handle; 24 acpi_handle handle;
25 unsigned int pin; 25 unsigned int pin;
26 unsigned int irq; 26 unsigned int irq;
27}; 27};
28 28
29struct acpi_gpio_chip { 29struct acpi_gpio_chip {
30 struct gpio_chip *chip; 30 struct gpio_chip *chip;
31 struct list_head evt_pins; 31 struct list_head events;
32}; 32};
33 33
34static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) 34static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
@@ -79,9 +79,9 @@ static irqreturn_t acpi_gpio_irq_handler(int irq, void *data)
79 79
80static irqreturn_t acpi_gpio_irq_handler_evt(int irq, void *data) 80static irqreturn_t acpi_gpio_irq_handler_evt(int irq, void *data)
81{ 81{
82 struct acpi_gpio_evt_pin *evt_pin = data; 82 struct acpi_gpio_event *event = data;
83 83
84 acpi_execute_simple_method(evt_pin->evt_handle, NULL, evt_pin->pin); 84 acpi_execute_simple_method(event->handle, NULL, event->pin);
85 85
86 return IRQ_HANDLED; 86 return IRQ_HANDLED;
87} 87}
@@ -119,7 +119,7 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio)
119 if (!handle) 119 if (!handle)
120 return; 120 return;
121 121
122 INIT_LIST_HEAD(&acpi_gpio->evt_pins); 122 INIT_LIST_HEAD(&acpi_gpio->events);
123 123
124 /* 124 /*
125 * If a GPIO interrupt has an ACPI event handler method, or _EVT is 125 * If a GPIO interrupt has an ACPI event handler method, or _EVT is
@@ -157,22 +157,22 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio)
157 } 157 }
158 } 158 }
159 if (!handler) { 159 if (!handler) {
160 struct acpi_gpio_evt_pin *evt_pin; 160 struct acpi_gpio_event *event;
161 161
162 status = acpi_get_handle(handle, "_EVT", &evt_handle); 162 status = acpi_get_handle(handle, "_EVT", &evt_handle);
163 if (ACPI_FAILURE(status)) 163 if (ACPI_FAILURE(status))
164 continue 164 continue
165 165
166 evt_pin = kzalloc(sizeof(*evt_pin), GFP_KERNEL); 166 event = kzalloc(sizeof(*event), GFP_KERNEL);
167 if (!evt_pin) 167 if (!event)
168 continue; 168 continue;
169 169
170 list_add_tail(&evt_pin->node, &acpi_gpio->evt_pins); 170 list_add_tail(&event->node, &acpi_gpio->events);
171 evt_pin->evt_handle = evt_handle; 171 event->handle = evt_handle;
172 evt_pin->pin = pin; 172 event->pin = pin;
173 evt_pin->irq = irq; 173 event->irq = irq;
174 handler = acpi_gpio_irq_handler_evt; 174 handler = acpi_gpio_irq_handler_evt;
175 data = evt_pin; 175 data = event;
176 } 176 }
177 if (!handler) 177 if (!handler)
178 continue; 178 continue;
@@ -199,17 +199,16 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio)
199 */ 199 */
200static void acpi_gpiochip_free_interrupts(struct acpi_gpio_chip *acpi_gpio) 200static void acpi_gpiochip_free_interrupts(struct acpi_gpio_chip *acpi_gpio)
201{ 201{
202 struct acpi_gpio_evt_pin *evt_pin, *ep; 202 struct acpi_gpio_event *event, *ep;
203 struct gpio_chip *chip = acpi_gpio->chip; 203 struct gpio_chip *chip = acpi_gpio->chip;
204 204
205 if (!chip->dev || !chip->to_irq) 205 if (!chip->dev || !chip->to_irq)
206 return; 206 return;
207 207
208 list_for_each_entry_safe_reverse(evt_pin, ep, &acpi_gpio->evt_pins, 208 list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
209 node) { 209 devm_free_irq(chip->dev, event->irq, event);
210 devm_free_irq(chip->dev, evt_pin->irq, evt_pin); 210 list_del(&event->node);
211 list_del(&evt_pin->node); 211 kfree(event);
212 kfree(evt_pin);
213 } 212 }
214} 213}
215 214