aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds')
-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 c392c1e95531..cde85ba1903a 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
170{ 170{
171 struct device_node *np = pdev->dev.of_node, *child; 171 struct device_node *np = pdev->dev.of_node, *child;
172 struct gpio_leds_priv *priv; 172 struct gpio_leds_priv *priv;
173 int count = 0, ret; 173 int count, ret;
174 174
175 /* count LEDs in this device, so we know how much to allocate */ 175 /* count LEDs in this device, so we know how much to allocate */
176 for_each_child_of_node(np, child) 176 count = of_get_child_count(np);
177 count++;
178 if (!count) 177 if (!count)
179 return NULL; 178 return NULL;
180 179