aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2017-05-23 20:03:17 +0300
committerLinus Walleij <[email protected]>2017-05-29 11:16:11 +0200
commit9e66504a919439448dfc57052ddf01b96964bdf7 (patch)
tree2fbb77757bc34e4b67f83981d4363a7b2a218d62
parentc29fd9ebb2b9d4bab16dfdce88547f9867ea6153 (diff)
gpio: acpi: Align acpi_find_gpio() with DT version
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 <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Jarkko Nikula <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
-rw-r--r--drivers/gpio/gpiolib-acpi.c4
1 files 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