aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <klto@zhaw.ch>2012-08-21 17:21:53 +0800
committerBryan Wu <bryan.wu@canonical.com>2012-09-11 18:32:40 +0800
commit127aedc8ecae2628511533ddeb239e99e4bed5e8 (patch)
treef7824b0c09444ea79e07cb0582dcd43286f94584
parent59c4dce13018b04275478e95b3929eca55afcdfb (diff)
leds: leds-gpio: Use of_get_child_count() helper
Use of_get_child_count() instead of custom implementation. Signed-off-by: Tobias Klauser <klto@zhaw.ch> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
-rw-r--r--drivers/leds/leds-gpio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index c392c1e9553..cde85ba1903 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -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 gpio_leds_priv *priv;
- int count = 0, ret;
+ int count, ret;
/* count LEDs in this device, so we know how much to allocate */
- for_each_child_of_node(np, child)
- count++;
+ count = of_get_child_count(np);
if (!count)
return NULL;