diff options
author | Jonathan Corbet <corbet@lwn.net> | 2013-04-30 22:42:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 18:08:57 -0700 |
commit | a7b594b4905828b3bfc36be39d48b5e07a23c8e1 (patch) | |
tree | 50a0ceb69d64d652ebb2ac83924d5f85fa930cf2 /drivers/misc | |
parent | f722406faae2d073cc1d01063d1123c35425939e (diff) |
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: Dave Jones <davej@redhat.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/dummy-irq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/misc/dummy-irq.c b/drivers/misc/dummy-irq.c index 7014167e2c6..c37eeedfe21 100644 --- a/drivers/misc/dummy-irq.c +++ b/drivers/misc/dummy-irq.c @@ -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; |