Skip to content

Commit

Permalink
Input: gpio_keys - switch to using request_any_context_irq
Browse files Browse the repository at this point in the history
The driver does not require hardirq context and can work with threaded
interrupts as well, so let's switch to request_any_context_irq which
will select the context that is available for us.

Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Philippe Langlais authored and Dmitry Torokhov committed Jan 21, 2011
1 parent 48c2701 commit 94a8cab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static void gpio_keys_report_event(struct gpio_button_data *bdata)
struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
unsigned int type = button->type ?: EV_KEY;
int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low;
int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;

input_event(input, type, button->code, !!state);
input_sync(input);
Expand Down Expand Up @@ -410,8 +410,8 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
if (!button->can_disable)
irqflags |= IRQF_SHARED;

error = request_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
if (error) {
error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata);
if (error < 0) {
dev_err(dev, "Unable to claim irq %d; error %d\n",
irq, error);
goto fail3;
Expand Down

0 comments on commit 94a8cab

Please sign in to comment.