diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-05-03 13:14:46 -0400 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2018-05-16 08:35:24 -0400 |
| commit | 4b21f94a3001ba5326425d6b6d93bc63ddebdc97 (patch) | |
| tree | 64c8f3b0cc1d57b0964ca766c67f0e89ecd102f6 /drivers/gpio | |
| parent | 6906a4f9d10b27853e80998afcfb290d8f91c071 (diff) | |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
| -rw-r--r-- | drivers/gpio/gpiolib-of.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 586d15137c03..28d968088131 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
| @@ -210,11 +210,8 @@ static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char * | |||
| 210 | if (!con_id) | 210 | if (!con_id) |
| 211 | return ERR_PTR(-ENOENT); | 211 | return ERR_PTR(-ENOENT); |
| 212 | 212 | ||
| 213 | for (i = 0; i < ARRAY_SIZE(whitelist); i++) | 213 | i = match_string(whitelist, ARRAY_SIZE(whitelist), con_id); |
| 214 | if (!strcmp(con_id, whitelist[i])) | 214 | if (i < 0) |
| 215 | break; | ||
| 216 | |||
| 217 | if (i == ARRAY_SIZE(whitelist)) | ||
| 218 | return ERR_PTR(-ENOENT); | 215 | return ERR_PTR(-ENOENT); |
| 219 | 216 | ||
| 220 | desc = of_get_named_gpiod_flags(np, con_id, 0, of_flags); | 217 | desc = of_get_named_gpiod_flags(np, con_id, 0, of_flags); |
