Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933252AbbBIRio (ORCPT ); Mon, 9 Feb 2015 12:38:44 -0500 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:60317 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760901AbbBIRim (ORCPT ); Mon, 9 Feb 2015 12:38:42 -0500 X-ME-Helo: beldin X-ME-Date: Mon, 09 Feb 2015 18:38:41 +0100 X-ME-IP: 109.220.218.8 From: Robert Jarzmik To: "Holmberg\, Hans" , Tyler Hall Cc: Alexandre Courbot , "linux-gpio\@vger.kernel.org" , "devicetree\@vger.kernel.org" , Daniel Mack , Linus Walleij , Linux Kernel Mailing List , Howard Cochran Subject: Re: gpio-pxa: getting GPIOs by devicetree phandle broken References: <4B6D6D87A8FB62428BE0A3E38461A1AB18D6B200@irsmsx105.ger.corp.intel.com> X-URL: http://belgarath.falguerolles.org/ Date: Mon, 09 Feb 2015 18:38:39 +0100 In-Reply-To: (Tyler Hall's message of "Mon, 9 Feb 2015 09:41:17 -0500") Message-ID: <87mw4n6l40.fsf@free.fr> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1822 Lines: 45 Tyler Hall writes: >> The issue with multiple gpiochips per of-node could be worked around as followed I believe, comments? >> >> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c >> index 08261f2..43984ab 100644 >> --- a/drivers/gpio/gpiolib-of.c >> +++ b/drivers/gpio/gpiolib-of.c >> @@ -47,11 +47,12 @@ static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data) >> ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags); >> if (ret < 0) { >> /* We've found the gpio chip, but the translation failed. >> - * Return true to stop looking and return the translation >> - * error via out_gpio >> + * Store translation error in out_gpio. >> + * Return false to keep looking, as more than one GPIO chip >> + * could be registered per of-node. >> */ >> gg_data->out_gpio = ERR_PTR(ret); >> - return true; >> + return false; >> } >> >> gg_data->out_gpio = gpiochip_get_desc(gc, ret); > > As long as we're ok with multiple gpiochips per of-node, this would > work for me. It'll change the preference of which chip returns the > error in the case of multiple chips, but that's already undefined > behavior. Looks good to me too, this will solve my issue, and the global behavior would be consistent with the former one. Would you care submitting a proper patch so that we can apply our Reviewed-by, Tested-by etc ... ? Cheers. -- Robert -- 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/