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 коммит произвёл Greg Kroah-Hartman
Родитель f722406faa
Коммит a7b594b490
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

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