提交 127aedc8 编写于 作者: T Tobias Klauser 提交者: Bryan Wu

leds: leds-gpio: Use of_get_child_count() helper

Use of_get_child_count() instead of custom implementation.
Signed-off-by: NTobias Klauser <klto@zhaw.ch>
Signed-off-by: NBryan Wu <bryan.wu@canonical.com>
上级 59c4dce1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册