Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755000AbdCWUN2 (ORCPT ); Thu, 23 Mar 2017 16:13:28 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35117 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbdCWUN0 (ORCPT ); Thu, 23 Mar 2017 16:13:26 -0400 Date: Thu, 23 Mar 2017 13:13:22 -0700 From: Dmitry Torokhov To: Andy Shevchenko 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 Subject: Re: [PATCH v1 2/8] gpio: acpi: Align acpi_find_gpio() with DT version Message-ID: <20170323201322.GC2502@dtor-ws> References: <20170323194618.26548-1-andriy.shevchenko@linux.intel.com> <20170323194618.26548-3-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170323194618.26548-3-andriy.shevchenko@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1465 Lines: 43 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