Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 655efa0f authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: gpio-regulator: Use of_gpio_count()

parent 949db153
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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,