From a7b594b4905828b3bfc36be39d48b5e07a23c8e1 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Tue, 30 Apr 2013 22:42:33 +0200 Subject: 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 Signed-off-by: Jonathan Corbet Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/misc/dummy-irq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers') 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 @@ #include #include -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; -- cgit v1.2.3