linux-mips
[Top] [All Lists]

Re: [PATCH v2 07/10] of/irq: Propagate errors in of_irq_to_resource_tabl

To: Rob Herring <robherring2@gmail.com>
Subject: Re: [PATCH v2 07/10] of/irq: Propagate errors in of_irq_to_resource_table()
From: Thierry Reding <thierry.reding@gmail.com>
Date: Mon, 23 Sep 2013 10:36:06 +0200
Cc: Rob Herring <rob.herring@calxeda.com>, Grant Likely <grant.likely@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thomas Gleixner <tglx@linutronix.de>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Ralf Baechle <ralf@linux-mips.org>, Russell King <linux@arm.linux.org.uk>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, linux-mips@linux-mips.org, linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, sparclinux@vger.kernel.org, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=q4XieE6R49gXif/9q3oCJZj+2WOQKjZeMk9Z/mFI/5Y=; b=oYo4Iyqxiwq6aFsG2LtjEH9A4u2gL1G5/v/ioCgRXaSpgpdosRfq86exIsi5dwi8Rr zCS1XbHKYCTYkmdV+aYT8d2A3lrbOfu7p131dacGb4b6MD5hJwh1XA3iU/riKOH/eGze vrkeiUoGn+i/bKevdj9LcUvJcV3xJd3p3F1iBeNzCUCRdQ+OXnbG0zlvJYu4NPtTqWzb MenhVaud4F1L7CYud7oZzPwnbmaJbNIDnVgS/7aZsHDCAHrkN+w4w1OvBC302YZ2WWYZ r8BMP//sYFNmua6NATCZqXK8QIEDHQovjx9S6RoQLgjsPfTjwlHlxtCmFkNFrwfcyhlY 1Nug==
In-reply-to: <CAL_JsqJ+4P26hRrJcrbBmwfNPDAS+1GhXj12B+UvqmZZGjqT0g@mail.gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1379510692-32435-1-git-send-email-treding@nvidia.com> <1379510692-32435-8-git-send-email-treding@nvidia.com> <CAL_JsqJ+4P26hRrJcrbBmwfNPDAS+1GhXj12B+UvqmZZGjqT0g@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Sun, Sep 22, 2013 at 04:08:26PM -0500, Rob Herring wrote:
> On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > Now that all helpers return precise error codes, this function can
> > propagate these errors to the caller properly.
> >
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > Changes in v2:
> > - return 0 on success or a negative error code on failure
> > - convert callers to new calling convention
> 
> [snip]
> 
> > diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> > index e4f38c0..6d7f824 100644
> > --- a/drivers/of/irq.c
> > +++ b/drivers/of/irq.c
> > @@ -397,18 +397,20 @@ int of_irq_count(struct device_node *dev)
> >   * @res: array of resources to fill in
> >   * @nr_irqs: the number of IRQs (and upper bound for num of @res elements)
> 
> You are effectively changing this to require an exact match rather
> than an upper bound. That seems to be okay since that is what all the
> callers want, but the documentation should be updated.

Done.

> >   *
> > - * Returns the size of the filled in table (up to @nr_irqs).
> > + * Returns 0 on success or a negative error code on failure.
> >   */
> >  int of_irq_to_resource_table(struct device_node *dev, struct resource *res,
> >                 int nr_irqs)
> >  {
> > -       int i;
> > +       int i, ret;
> >
> > -       for (i = 0; i < nr_irqs; i++, res++)
> > -               if (!of_irq_to_resource(dev, i, res))
> 
> The error handling here needs to be updated in the previous patch.

Yes, you're right.

Thanks,
Thierry

Attachment: pgppINBqLLU62.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>