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

Commit 127aedc8 authored by Tobias Klauser's avatar Tobias Klauser Committed by Bryan Wu
Browse files

leds: leds-gpio: Use of_get_child_count() helper



Use of_get_child_count() instead of custom implementation.

Signed-off-by: default avatarTobias Klauser <klto@zhaw.ch>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
parent 59c4dce1
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -170,11 +170,10 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev
{
{
	struct device_node *np = pdev->dev.of_node, *child;
	struct device_node *np = pdev->dev.of_node, *child;
	struct gpio_leds_priv *priv;
	struct gpio_leds_priv *priv;
	int count = 0, ret;
	int count, ret;


	/* count LEDs in this device, so we know how much to allocate */
	/* count LEDs in this device, so we know how much to allocate */
	for_each_child_of_node(np, child)
	count = of_get_child_count(np);
		count++;
	if (!count)
	if (!count)
		return NULL;
		return NULL;