提交 4f485447 编写于 作者: D Dmitri Vorobiev 提交者: 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: NDmitri Vorobiev <dmitri.vorobiev@movial.fi>
Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册