aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/dummy-irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/dummy-irq.c')
-rw-r--r--drivers/misc/dummy-irq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/misc/dummy-irq.c b/drivers/misc/dummy-irq.c
index 7014167e2c61..c37eeedfe215 100644
--- a/drivers/misc/dummy-irq.c
+++ b/drivers/misc/dummy-irq.c
@@ -19,7 +19,7 @@
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21 21
22static int irq; 22static int irq = -1;
23 23
24static irqreturn_t dummy_interrupt(int irq, void *dev_id) 24static irqreturn_t dummy_interrupt(int irq, void *dev_id)
25{ 25{
@@ -36,6 +36,10 @@ static irqreturn_t dummy_interrupt(int irq, void *dev_id)
36 36
37static int __init dummy_irq_init(void) 37static int __init dummy_irq_init(void)
38{ 38{
39 if (irq < 0) {
40 printk(KERN_ERR "dummy-irq: no IRQ given. Use irq=N\n");
41 return -EIO;
42 }
39 if (request_irq(irq, &dummy_interrupt, IRQF_SHARED, "dummy_irq", &irq)) { 43 if (request_irq(irq, &dummy_interrupt, IRQF_SHARED, "dummy_irq", &irq)) {
40 printk(KERN_ERR "dummy-irq: cannot register IRQ %d\n", irq); 44 printk(KERN_ERR "dummy-irq: cannot register IRQ %d\n", irq);
41 return -EIO; 45 return -EIO;