lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/3] leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack
On Wed, Jan 14, 2015 at 5:51 AM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> 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

Looks good, applied to my tree.
Thanks,
-Bryan


> ---
> Compile-tested only
> ---
> drivers/leds/leds-mc13783.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
> index 85c3714e1b5aabba..e2b847fe22a1c934 100644
> --- a/drivers/leds/leds-mc13783.c
> +++ b/drivers/leds/leds-mc13783.c
> @@ -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;
>
> --
> 1.9.1
>


\
 
 \ /
  Last update: 2015-01-14 20:01    [W:0.107 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site