Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;