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>
This commit is contained in:
Axel Lin 2013-01-28 22:16:03 +08:00 committed by Mark Brown
parent 949db153b6
commit 655efa0ff2
1 changed files with 1 additions and 4 deletions

View File

@ -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); config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0);
/* Fetch GPIOs. */ /* Fetch GPIOs. */
for (i = 0; ; i++) config->nr_gpios = of_gpio_count(np);
if (of_get_named_gpio(np, "gpios", i) < 0)
break;
config->nr_gpios = i;
config->gpios = devm_kzalloc(dev, config->gpios = devm_kzalloc(dev,
sizeof(struct gpio) * config->nr_gpios, sizeof(struct gpio) * config->nr_gpios,