Skip to content

Commit

Permalink
leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack
Browse files Browse the repository at this point in the history
of_find_node_by_name() calls of_node_put() on its "from" parameter.
To counter this, mc13xxx_led_probe_dt() calls of_node_get() first.

Use of_get_child_by_name() instead to get rid of the refcount hack.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-leds@vger.kernel.org
Signed-off-by: Bryan Wu <cooloney@gmail.com>
  • Loading branch information
Geert Uytterhoeven authored and Bryan Wu committed Jan 14, 2015
1 parent 137fe48 commit 452bc14
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/leds/leds-mc13783.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ static struct mc13xxx_leds_platform_data __init *mc13xxx_led_probe_dt(
if (!pdata)
return ERR_PTR(-ENOMEM);

of_node_get(dev->parent->of_node);

parent = of_find_node_by_name(dev->parent->of_node, "leds");
parent = of_get_child_by_name(dev->parent->of_node, "leds");
if (!parent)
goto out_node_put;

Expand Down

0 comments on commit 452bc14

Please sign in to comment.