2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 18:23:53 +08:00

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>
This commit is contained in:
Jonathan Corbet 2013-04-30 22:42:33 +02:00 committed by Greg Kroah-Hartman
parent f722406faa
commit a7b594b490

View File

@ -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;