From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Matt Sealey <matt@genesi-usa.com>,
Steev Klimaszewski <steev@genesi-usa.com>,
Yong Shen <yong.shen@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] regulator: mc13xxx: Use of_get_child_count()
Date: Wed, 30 Jan 2013 20:54:49 +0800 [thread overview]
Message-ID: <1359550489.3885.8.camel@phoenix> (raw)
In-Reply-To: <1359550369.3885.6.camel@phoenix>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
hi Mark,
I generate this patch against for-next branch of regulator tree.
So this patch is on top of commit c92f5dd2c "regulator: Add missing of_node_put()".
Which means it can only be applied to topic/of branch now.
If you prefer apply it to other branch, I can resend and generate the patch against
proper topic branch.
Axel
drivers/regulator/mc13xxx-regulator-core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index 04cf962..5186adc 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -164,17 +164,15 @@ EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_ops);
#ifdef CONFIG_OF
int mc13xxx_get_num_regulators_dt(struct platform_device *pdev)
{
- struct device_node *parent, *child;
- int num = 0;
+ struct device_node *parent;
+ int num;
of_node_get(pdev->dev.parent->of_node);
parent = of_find_node_by_name(pdev->dev.parent->of_node, "regulators");
if (!parent)
return -ENODEV;
- for_each_child_of_node(parent, child)
- num++;
-
+ num = of_get_child_count(parent);
of_node_put(parent);
return num;
}
--
1.7.9.5
next prev parent reply other threads:[~2013-01-30 12:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 12:52 [PATCH 1/2] regulator: max8997: Use of_get_child_count() Axel Lin
2013-01-30 12:54 ` Axel Lin [this message]
2013-01-31 6:44 ` Mark Brown
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=1359550489.3885.8.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@genesi-usa.com \
--cc=steev@genesi-usa.com \
--cc=yong.shen@linaro.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox