From patchwork Wed Sep 18 13:24:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 2906841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1954E9F1E3 for ; Wed, 18 Sep 2013 13:26:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D684201C0 for ; Wed, 18 Sep 2013 13:26:49 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5B7820154 for ; Wed, 18 Sep 2013 13:26:47 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VMHmH-000552-6I; Wed, 18 Sep 2013 13:26:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VMHmE-0002Ou-RK; Wed, 18 Sep 2013 13:26:42 +0000 Received: from mail-bk0-f50.google.com ([209.85.214.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VMHmB-0002NT-Ar for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2013 13:26:40 +0000 Received: by mail-bk0-f50.google.com with SMTP id mz11so2763094bkb.23 for ; Wed, 18 Sep 2013 06:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5Q0KmXVxA3axiF1QfSfX9nR5UTPk40ySv/j033sM998=; b=ONESxbL7wVzylxPvIN2ACHOosYmqtfIV5bTG4iMTW1xUQWxhEEz98/P9G2asjy77+1 VC2wyRBVLvqsOE88+TVGuoSIOwY7wDyUOpwlMJXi0x3iGzT4BxHIuLSk+vwnq9YpoAqD gZ4IMfTEsSg+0gdblWXY9ChPYKdGd8i2R0by05gsUIo6v2iaChQmw2+EYBoxEyBdZLYp R7Wa6ooNFtjT2bNV/6D9X6H9ZypqYLqNdlZx65CV5xTTtl4HIGbHh3EuVWB4JggY95gP /oos7xvP4bCkrcX5P8+8ik/mPrwFF4J6pD8CItaTLpfdxY02etofFNOhLFSZHMU617Cb 7UAw== X-Received: by 10.205.105.73 with SMTP id dp9mr2002034bkc.33.1379510764437; Wed, 18 Sep 2013 06:26:04 -0700 (PDT) Received: from localhost (port-55509.pppoe.wtnet.de. [46.59.217.135]) by mx.google.com with ESMTPSA id qe6sm901789bkb.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Sep 2013 06:26:03 -0700 (PDT) From: Thierry Reding To: Rob Herring , Grant Likely , Greg Kroah-Hartman , Thomas Gleixner Subject: [PATCH v2 01/10] of/irq: Rework of_irq_count() Date: Wed, 18 Sep 2013 15:24:43 +0200 Message-Id: <1379510692-32435-2-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1379510692-32435-1-git-send-email-treding@nvidia.com> References: <1379510692-32435-1-git-send-email-treding@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130918_092639_491927_82E1B966 X-CRM114-Status: GOOD ( 11.12 ) X-Spam-Score: 0.9 (/) Cc: linux-mips@linux-mips.org, Russell King , devicetree@vger.kernel.org, Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Ralf Baechle , sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The of_irq_to_resource() helper that is used to implement of_irq_count() tries to resolve interrupts and in fact creates a mapping for resolved interrupts. That's pretty heavy lifting for something that claims to just return the number of interrupts requested by a given device node. Instead, use the more lightweight of_irq_map_one(), which, despite the name, doesn't create an actual mapping. Perhaps a better name would be of_irq_translate_one(). Signed-off-by: Thierry Reding Acked-by: Rob Herring --- drivers/of/irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 1752988..5f44388 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -368,9 +368,10 @@ EXPORT_SYMBOL_GPL(of_irq_to_resource); */ int of_irq_count(struct device_node *dev) { + struct of_irq irq; int nr = 0; - while (of_irq_to_resource(dev, nr, NULL)) + while (of_irq_map_one(dev, nr, &irq) == 0) nr++; return nr;