Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933720Ab3D3Umh (ORCPT ); Tue, 30 Apr 2013 16:42:37 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58711 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933307Ab3D3Umf (ORCPT ); Tue, 30 Apr 2013 16:42:35 -0400 Date: Tue, 30 Apr 2013 22:42:33 +0200 (CEST) From: Jiri Kosina To: Jonathan Corbet , Greg Kroah-Hartman Cc: Dave Jones , Linux Kernel Subject: [PATCH] dummy-irq: require the user to specify an IRQ number In-Reply-To: <20130430072817.61d3ca9f@lwn.net> Message-ID: References: <20130429211605.GA4102@redhat.com> <20130430072817.61d3ca9f@lwn.net> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1325 Lines: 42 From: Jonathan Corbet Subject: [PATCH] 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 diff --git a/drivers/misc/dummy-irq.c b/drivers/misc/dummy-irq.c index 7014167..c37eeed 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; -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/