Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / Documentation / input / input-programming.txt
index 4d932dc660982d34fe488a2e9d8f10957a4d030b..7f8b9d97bc47d32359150822eaa16b23acfc13be 100644 (file)
@@ -20,10 +20,11 @@ pressed or released a BUTTON_IRQ happens. The driver could look like:
 
 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_1, inb(BUTTON_PORT) & 1);
+       input_report_key(button_dev, BTN_0, inb(BUTTON_PORT) & 1);
        input_sync(button_dev);
+       return IRQ_HANDLED;
 }
 
 static int __init button_init(void)
@@ -79,7 +80,7 @@ In the _init function, which is called either upon module load or when
 booting the kernel, it grabs the required resources (it should also check
 for the presence of the device).
 
-Then it allocates a new input device structure with input_aloocate_device()
+Then it allocates a new input device structure with input_allocate_device()
 and sets up input bitfields. This way the device driver tells the other
 parts of the input systems what it is - what events can be generated or
 accepted by this input device. Our example device can only generate EV_KEY