LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	Jingoo Han <jg1.han@samsung.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-leds@vger.kernel.org
Subject: [PATCH 2/3] leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack
Date: Wed, 14 Jan 2015 14:51:58 +0100	[thread overview]
Message-ID: <1421243519-6257-3-git-send-email-geert+renesas@glider.be> (raw)
In-Reply-To: <1421243519-6257-1-git-send-email-geert+renesas@glider.be>

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
---
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


  parent reply	other threads:[~2015-01-14 13:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 13:51 [PATCH 0/3] Use of_get_child_by_name() instead of of_find_node_by_name() Geert Uytterhoeven
2015-01-14 13:51 ` [PATCH 1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle Geert Uytterhoeven
2015-01-30  4:09   ` [1/3] " Michael Ellerman
2015-01-30  9:00     ` Geert Uytterhoeven
2015-02-03  1:12       ` Michael Ellerman
2015-01-14 13:51 ` Geert Uytterhoeven [this message]
2015-01-14 18:42   ` [PATCH 2/3] leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack Bryan Wu
2015-01-14 13:51 ` [PATCH 3/3] backlight: 88pm860x_bl: " Geert Uytterhoeven
2015-01-18 12:46   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421243519-6257-3-git-send-email-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=benh@kernel.crashing.org \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jg1.han@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --subject='Re: [PATCH 2/3] leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).