Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752954Ab3IVVI3 (ORCPT ); Sun, 22 Sep 2013 17:08:29 -0400 Received: from mail-qe0-f41.google.com ([209.85.128.41]:58020 "EHLO mail-qe0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647Ab3IVVI1 (ORCPT ); Sun, 22 Sep 2013 17:08:27 -0400 MIME-Version: 1.0 In-Reply-To: <1379510692-32435-8-git-send-email-treding@nvidia.com> References: <1379510692-32435-1-git-send-email-treding@nvidia.com> <1379510692-32435-8-git-send-email-treding@nvidia.com> Date: Sun, 22 Sep 2013 16:08:26 -0500 Message-ID: Subject: Re: [PATCH v2 07/10] of/irq: Propagate errors in of_irq_to_resource_table() From: Rob Herring To: Thierry Reding Cc: Rob Herring , Grant Likely , Greg Kroah-Hartman , Thomas Gleixner , Benjamin Herrenschmidt , Ralf Baechle , Russell King , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-mips@linux-mips.org, linuxppc-dev , sparclinux@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1937 Lines: 57 On Wed, Sep 18, 2013 at 8:24 AM, Thierry Reding wrote: > Now that all helpers return precise error codes, this function can > propagate these errors to the caller properly. > > Signed-off-by: Thierry Reding > --- > 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. > * > - * 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. > - break; > + for (i = 0; i < nr_irqs; i++, res++) { > + ret = of_irq_to_resource(dev, i, res); > + if (ret < 0) > + return ret; > + } > > - return i; > + return 0; > } > EXPORT_SYMBOL_GPL(of_irq_to_resource_table); > -- 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/