Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Dmitry Torokhov Newsgroups: linux.kernel Subject: Re: [PATCH v1 2/8] gpio: acpi: Align acpi_find_gpio() with DT version Date: Thu, 23 Mar 2017 21:20:01 +0100 Message-ID: References: Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tK7hLP37ELeX61qvMmVdUaqiY832US7aDd9q95KQUCE=; b=aUQYT23GE0AQ+XmL6RLWf2GJ3JJYG0rxciJOag1bjvjgIRS+TPoZek2yxdabU8pisZ /0xOlsUiduAHdyBERAPtwlkqH+fkKsIHFFEA8HNUI2FJXa0D3hP5xiaUEcvrQWxGxnYn +hHUEc1P9guGX1BO9QHdEGwhVDxx3JmzPEhqGFxo1i7QHB05WgcE/N4Zd3u+m+6rpBoe bJbmDG/cAEPrP0ARrA0Rk9OiBGg6mdL/FifLe2LOOsBHS3OoxRBjLJB39l/loM5MeTuw EdFaWwazGg970uVw4vi8jhgxnKgyUey+bMP+3XbeFuxkNbSCCq0zJs2arZkGIn8S+7qA tSGQ== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tK7hLP37ELeX61qvMmVdUaqiY832US7aDd9q95KQUCE=; b=OoeqxwfN8gVjY9xSt7V/G8PvbaDbhhJ96b4r5PdbuP+s9vm2mcza0djqo+frKkWeCQ 4BoY57+KgzPsfdVxuGOlJrbO5lNucqYNBh4PWB1Euh4+RaA+2YkVqj/+CipjFrLfPWxA uebN2yFC2ia4GG16vlABR7R6VxjydkoIp8NV5v904pfJXZ7mef/Wlk/7/aVJM1N/6w23 /avFfg9Ecgsy4PVD5QLNl6qUcN5N+eOc9MB+g1ovaIRx06FuKiGo9zDxqg7smHZsbAdn ig5AqA3RcBrrV71euxqn3hKKM0Jd0YGX/euAghwfyZ/TIaAmL5s029czTAwOi+Pi/OrQ Ir7w== X-Gm-Message-State: AFeK/H2fhjvmPBF2UbMf8HaEp8W78nB9MILo/nZ8LUelJCAFx3QimLcdY3w7zPhpxFQSUQ== X-Received: by 10.98.15.145 with SMTP id 17mr4853231pfp.183.1490300005194; Thu, 23 Mar 2017 13:13:25 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 43 Organization: linux.* mail to news gateway X-Original-Cc: Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, Hans de Goede , linux-kernel@vger.kernel.org, Mika Westerberg , Jarkko Nikula , linux-acpi@vger.kernel.org X-Original-Date: Thu, 23 Mar 2017 13:13:22 -0700 X-Original-Message-ID: <20170323201322.GC2502@dtor-ws> X-Original-References: <20170323194618.26548-1-andriy.shevchenko@linux.intel.com> <20170323194618.26548-3-andriy.shevchenko@linux.intel.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1607866 On Thu, Mar 23, 2017 at 09:46:12PM +0200, Andy Shevchenko wrote: > By some reason acpi_find_gpio() and acpi_gpio_count() have compared connection > ID to "gpios" when tries to check if suffix is needed or not. > > Don't do any assumptions about what connection ID can be and, when defined, use > it only with suffix as it's done in the device tree version. > > Signed-off-by: Andy Shevchenko Reviewed-by: Dmitry Torokhov > --- > drivers/gpio/gpiolib-acpi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c > index 56a6b1be3a17..3bda3166d418 100644 > --- a/drivers/gpio/gpiolib-acpi.c > +++ b/drivers/gpio/gpiolib-acpi.c > @@ -593,7 +593,7 @@ struct gpio_desc *acpi_find_gpio(struct device *dev, > > /* Try first from _DSD */ > for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) { > - if (con_id && strcmp(con_id, "gpios")) { > + if (con_id) { > snprintf(propname, sizeof(propname), "%s-%s", > con_id, gpio_suffixes[i]); > } else { > @@ -1081,7 +1081,7 @@ int acpi_gpio_count(struct device *dev, const char *con_id) > > /* Try first from _DSD */ > for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) { > - if (con_id && strcmp(con_id, "gpios")) > + if (con_id) > snprintf(propname, sizeof(propname), "%s-%s", > con_id, gpio_suffixes[i]); > else > -- > 2.11.0 > -- Dmitry