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>
This commit is contained in:
Mika Westerberg 2014-03-10 14:54:52 +02:00 committed by Linus Walleij
parent aa92b6f689
commit 4b01a14bac

View File

@ -19,16 +19,16 @@
#include "gpiolib.h" #include "gpiolib.h"
struct acpi_gpio_evt_pin { struct acpi_gpio_event {
struct list_head node; struct list_head node;
acpi_handle *evt_handle; acpi_handle handle;
unsigned int pin; unsigned int pin;
unsigned int irq; unsigned int irq;
}; };
struct acpi_gpio_chip { struct acpi_gpio_chip {
struct gpio_chip *chip; struct gpio_chip *chip;
struct list_head evt_pins; struct list_head events;
}; };
static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) static 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)
static irqreturn_t acpi_gpio_irq_handler_evt(int irq, void *data) static irqreturn_t acpi_gpio_irq_handler_evt(int irq, void *data)
{ {
struct acpi_gpio_evt_pin *evt_pin = data; struct acpi_gpio_event *event = data;
acpi_execute_simple_method(evt_pin->evt_handle, NULL, evt_pin->pin); acpi_execute_simple_method(event->handle, NULL, event->pin);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
@ -119,7 +119,7 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio)
if (!handle) if (!handle)
return; return;
INIT_LIST_HEAD(&acpi_gpio->evt_pins); INIT_LIST_HEAD(&acpi_gpio->events);
/* /*
* If a GPIO interrupt has an ACPI event handler method, or _EVT is * 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)
} }
} }
if (!handler) { if (!handler) {
struct acpi_gpio_evt_pin *evt_pin; struct acpi_gpio_event *event;
status = acpi_get_handle(handle, "_EVT", &evt_handle); status = acpi_get_handle(handle, "_EVT", &evt_handle);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
continue continue
evt_pin = kzalloc(sizeof(*evt_pin), GFP_KERNEL); event = kzalloc(sizeof(*event), GFP_KERNEL);
if (!evt_pin) if (!event)
continue; continue;
list_add_tail(&evt_pin->node, &acpi_gpio->evt_pins); list_add_tail(&event->node, &acpi_gpio->events);
evt_pin->evt_handle = evt_handle; event->handle = evt_handle;
evt_pin->pin = pin; event->pin = pin;
evt_pin->irq = irq; event->irq = irq;
handler = acpi_gpio_irq_handler_evt; handler = acpi_gpio_irq_handler_evt;
data = evt_pin; data = event;
} }
if (!handler) if (!handler)
continue; continue;
@ -199,17 +199,16 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio)
*/ */
static void acpi_gpiochip_free_interrupts(struct acpi_gpio_chip *acpi_gpio) static void acpi_gpiochip_free_interrupts(struct acpi_gpio_chip *acpi_gpio)
{ {
struct acpi_gpio_evt_pin *evt_pin, *ep; struct acpi_gpio_event *event, *ep;
struct gpio_chip *chip = acpi_gpio->chip; struct gpio_chip *chip = acpi_gpio->chip;
if (!chip->dev || !chip->to_irq) if (!chip->dev || !chip->to_irq)
return; return;
list_for_each_entry_safe_reverse(evt_pin, ep, &acpi_gpio->evt_pins, list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
node) { devm_free_irq(chip->dev, event->irq, event);
devm_free_irq(chip->dev, evt_pin->irq, evt_pin); list_del(&event->node);
list_del(&evt_pin->node); kfree(event);
kfree(evt_pin);
} }
} }