提交 a7b594b4 编写于 作者: J Jonathan Corbet 提交者: Greg Kroah-Hartman

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: NDave Jones <davej@redhat.com>
Signed-off-by: NJonathan Corbet <corbet@lwn.net>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f722406f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册