aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/gpio_keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard/gpio_keys.c')
-rw-r--r--drivers/input/keyboard/gpio_keys.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index e2809d29d99d..fe22ca34d576 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -37,9 +37,10 @@ struct gpio_keys_drvdata {
37 struct gpio_button_data data[0]; 37 struct gpio_button_data data[0];
38}; 38};
39 39
40static void gpio_keys_report_event(struct gpio_keys_button *button, 40static void gpio_keys_report_event(struct gpio_button_data *bdata)
41 struct input_dev *input)
42{ 41{
42 struct gpio_keys_button *button = bdata->button;
43 struct input_dev *input = bdata->input;
43 unsigned int type = button->type ?: EV_KEY; 44 unsigned int type = button->type ?: EV_KEY;
44 int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low; 45 int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low;
45 46
@@ -51,7 +52,7 @@ static void gpio_check_button(unsigned long _data)
51{ 52{
52 struct gpio_button_data *data = (struct gpio_button_data *)_data; 53 struct gpio_button_data *data = (struct gpio_button_data *)_data;
53 54
54 gpio_keys_report_event(data->button, data->input); 55 gpio_keys_report_event(data);
55} 56}
56 57
57static irqreturn_t gpio_keys_isr(int irq, void *dev_id) 58static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
@@ -65,7 +66,7 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
65 mod_timer(&bdata->timer, 66 mod_timer(&bdata->timer,
66 jiffies + msecs_to_jiffies(button->debounce_interval)); 67 jiffies + msecs_to_jiffies(button->debounce_interval));
67 else 68 else
68 gpio_keys_report_event(button, bdata->input); 69 gpio_keys_report_event(bdata);
69 70
70 return IRQ_HANDLED; 71 return IRQ_HANDLED;
71} 72}