Commit 4f485447 authored by Dmitri Vorobiev's avatar Dmitri Vorobiev Committed by Dmitry Torokhov

Input: fix the example of an input device driver

This patch fixes a wrong interrupt handler example given in the "Hello,
world!"-like input driver in Documentation/input/input-programming.txt.
Signed-off-by: default avatarDmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 5fb17fd9
...@@ -20,10 +20,11 @@ pressed or released a BUTTON_IRQ happens. The driver could look like: ...@@ -20,10 +20,11 @@ pressed or released a BUTTON_IRQ happens. The driver could look like:
static struct input_dev *button_dev; static struct input_dev *button_dev;
static void button_interrupt(int irq, void *dummy, struct pt_regs *fp) static irqreturn_t button_interrupt(int irq, void *dummy)
{ {
input_report_key(button_dev, BTN_0, inb(BUTTON_PORT) & 1); input_report_key(button_dev, BTN_0, inb(BUTTON_PORT) & 1);
input_sync(button_dev); input_sync(button_dev);
return IRQ_HANDLED;
} }
static int __init button_init(void) static int __init button_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment