From 7df0326fc85f8429ffb6258712c9ed102bd63d27 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 27 Jan 2013 01:14:14 -0800 Subject: [PATCH] --- yaml --- r: 358628 b: refs/heads/master c: ef754e88e35f86d9704f79ac8dace8c66f367164 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/leds/leds-tca6507.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 837aacb6b833..e5c2da927ffe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ad0ba85fab7da9e634c9da4f96315c8d0b9febcb +refs/heads/master: ef754e88e35f86d9704f79ac8dace8c66f367164 diff --git a/trunk/drivers/leds/leds-tca6507.c b/trunk/drivers/leds/leds-tca6507.c index 220fc7fbf1f0..070ba0741b21 100644 --- a/trunk/drivers/leds/leds-tca6507.c +++ b/trunk/drivers/leds/leds-tca6507.c @@ -674,14 +674,10 @@ tca6507_led_dt_init(struct i2c_client *client) struct device_node *np = client->dev.of_node, *child; struct tca6507_platform_data *pdata; struct led_info *tca_leds; - int count = 0; + int count; - for_each_child_of_node(np, child) - count++; - if (!count) - return ERR_PTR(-ENODEV); - - if (count > NUM_LEDS) + count = of_get_child_count(np); + if (!count || count > NUM_LEDS) return ERR_PTR(-ENODEV); tca_leds = devm_kzalloc(&client->dev,