Commit a7b594b4 authored by Jonathan Corbet's avatar Jonathan Corbet Committed by Greg Kroah-Hartman

dummy-irq: require the user to specify an IRQ number

Make sure that we let the user know that without specifying IRQ#,
dummy-irq driver is useless.
Reported-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f722406f
......@@ -19,7 +19,7 @@
#include <linux/irq.h>
#include <linux/interrupt.h>
static int irq;
static int irq = -1;
static irqreturn_t dummy_interrupt(int irq, void *dev_id)
{
......@@ -36,6 +36,10 @@ static irqreturn_t dummy_interrupt(int irq, void *dev_id)
static int __init dummy_irq_init(void)
{
if (irq < 0) {
printk(KERN_ERR "dummy-irq: no IRQ given. Use irq=N\n");
return -EIO;
}
if (request_irq(irq, &dummy_interrupt, IRQF_SHARED, "dummy_irq", &irq)) {
printk(KERN_ERR "dummy-irq: cannot register IRQ %d\n", irq);
return -EIO;
......
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