From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6CD3D2C00BB for ; Mon, 23 Sep 2013 07:19:30 +1000 (EST) Received: by mail-qc0-f170.google.com with SMTP id m20so1571059qcx.15 for ; Sun, 22 Sep 2013 14:19:27 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1379510692-32435-2-git-send-email-treding@nvidia.com> References: <1379510692-32435-1-git-send-email-treding@nvidia.com> <1379510692-32435-2-git-send-email-treding@nvidia.com> Date: Sun, 22 Sep 2013 16:19:27 -0500 Message-ID: Subject: Re: [PATCH v2 01/10] of/irq: Rework of_irq_count() From: Rob Herring To: Thierry Reding Content-Type: text/plain; charset=ISO-8859-1 Cc: linux-mips@linux-mips.org, Russell King , "devicetree@vger.kernel.org" , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Rob Herring , sparclinux@vger.kernel.org, Ralf Baechle , Grant Likely , Thomas Gleixner , linuxppc-dev , "linux-arm-kernel@lists.infradead.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding wrote: > 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; > -- > 1.8.4 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel