From e04bd69c7dcb4acca0fdf19e4f93a953f6e3364e Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 30 Jan 2013 20:54:49 +0800 Subject: [PATCH] --- yaml --- r: 350449 b: refs/heads/master c: 86f6673325e38274c55f3df9f919d9a618f100d4 h: refs/heads/master i: 350447: 6a47bf419e7157d51711b9ff52cb018bcfd254c8 v: v3 --- [refs] | 2 +- trunk/drivers/regulator/mc13xxx-regulator-core.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 03ca53c2039e..00ba8ccfa846 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee70b258498174ba50b346960763203b7cba9d4a +refs/heads/master: 86f6673325e38274c55f3df9f919d9a618f100d4 diff --git a/trunk/drivers/regulator/mc13xxx-regulator-core.c b/trunk/drivers/regulator/mc13xxx-regulator-core.c index 5d2ab2ea0c8c..23cf9f9c383b 100644 --- a/trunk/drivers/regulator/mc13xxx-regulator-core.c +++ b/trunk/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; }