summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/gpio-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-01-28 22:16:03 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-29 00:44:17 +0800
commit655efa0ff202484ac1ec43156b98373b53a77eb3 (patch)
treebc7090cb5c07067ffa2b035d2c1f56bf4e78fc19 /drivers/regulator/gpio-regulator.c
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
downloadlinux-655efa0ff202484ac1ec43156b98373b53a77eb3.tar.gz
linux-655efa0ff202484ac1ec43156b98373b53a77eb3.tar.bz2
linux-655efa0ff202484ac1ec43156b98373b53a77eb3.zip
regulator: gpio-regulator: Use of_gpio_count()
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/gpio-regulator.c')
-rw-r--r--drivers/regulator/gpio-regulator.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index bae681ccd3ea..d819ba73a187 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -163,10 +163,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
/* Fetch GPIOs. */
- for (i = 0; ; i++)
- if (of_get_named_gpio(np, "gpios", i) < 0)
- break;
- config->nr_gpios = i;
+ config->nr_gpios = of_gpio_count(np);
config->gpios = devm_kzalloc(dev,
sizeof(struct gpio) * config->nr_gpios,