projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59c4dce
)
leds: leds-gpio: Use of_get_child_count() helper
author
Tobias Klauser
<klto@zhaw.ch>
Tue, 21 Aug 2012 09:21:53 +0000
(17:21 +0800)
committer
Bryan Wu
<bryan.wu@canonical.com>
Tue, 11 Sep 2012 10:32:40 +0000
(18:32 +0800)
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>
drivers/leds/leds-gpio.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/leds/leds-gpio.c
b/drivers/leds/leds-gpio.c
index c392c1e955311d199a00eb1bfa558b2def9a45f1..cde85ba1903ac2c79034afdb0044334b3c2fc9ab 100644
(file)
--- 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;