aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-01-28 09:16:03 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-28 11:44:17 -0500
commit655efa0ff202484ac1ec43156b98373b53a77eb3 (patch)
treebc7090cb5c07067ffa2b035d2c1f56bf4e78fc19
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
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>
-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)
163 config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0); 163 config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
164 164
165 /* Fetch GPIOs. */ 165 /* Fetch GPIOs. */
166 for (i = 0; ; i++) 166 config->nr_gpios = of_gpio_count(np);
167 if (of_get_named_gpio(np, "gpios", i) < 0)
168 break;
169 config->nr_gpios = i;
170 167
171 config->gpios = devm_kzalloc(dev, 168 config->gpios = devm_kzalloc(dev,
172 sizeof(struct gpio) * config->nr_gpios, 169 sizeof(struct gpio) * config->nr_gpios,