Skip to content

Commit

Permalink
regulator: gpio-regulator: Use of_gpio_count()
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jan 28, 2013
1 parent 949db15 commit 655efa0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/regulator/gpio-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 655efa0

Please sign in to comment.