Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1648280

[PATCH v2 02/12] gpio: acpi: Align acpi_find_gpio() with DT version

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v2 02/12] gpio: acpi: Align acpi_find_gpio() with DT version
Date 2017-05-23 19:10 +0200
Message-ID <tKltM-68D-19@gated-at.bofh.it> (permalink)
References <tKltL-68D-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 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 2185232da823..055a8a255a40 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -599,7 +599,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 {
@@ -1089,7 +1089,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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/12] gpio: acpi: Make it working Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200
  [PATCH v2 02/12] gpio: acpi: Align acpi_find_gpio() with DT version Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200
  [PATCH v2 11/12] PNP / ACPI: join strings back for better maintenance Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200
    Re: [PATCH v2 11/12] PNP / ACPI: join strings back for better  maintenance Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-24 14:10 +0200
  [PATCH v2 09/12] gpio: acpi: Split out acpi_gpio_get_irq_resource() helper Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200
    Re: [PATCH v2 09/12] gpio: acpi: Split out  acpi_gpio_get_irq_resource() helper Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-24 14:00 +0200
  [PATCH v2 08/12] gpio: acpi: Override GPIO initialization flags Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200
  [PATCH v2 12/12] PNP / ACPI: remove FSF address Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200
    Re: [PATCH v2 12/12] PNP / ACPI: remove FSF address Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-24 14:10 +0200
  [PATCH v2 01/12] gpiolib: Export gpiod_configure_flags() to internal users Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 19:10 +0200

csiph-web