Commit 4b21f94a authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

gpio: Convert to use match_string() helper

The new helper returns index of the matching string in an array.
We are going to use it here.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 6906a4f9
...@@ -210,11 +210,8 @@ static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char * ...@@ -210,11 +210,8 @@ static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char *
if (!con_id) if (!con_id)
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
for (i = 0; i < ARRAY_SIZE(whitelist); i++) i = match_string(whitelist, ARRAY_SIZE(whitelist), con_id);
if (!strcmp(con_id, whitelist[i])) if (i < 0)
break;
if (i == ARRAY_SIZE(whitelist))
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
desc = of_get_named_gpiod_flags(np, con_id, 0, of_flags); desc = of_get_named_gpiod_flags(np, con_id, 0, of_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment