projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee70b25
)
regulator: mc13xxx: Use of_get_child_count()
author
Axel Lin
<
[email protected]
>
Wed, 30 Jan 2013 12:54:49 +0000
(20:54 +0800)
committer
Mark Brown
<
[email protected]
>
Thu, 31 Jan 2013 06:43:32 +0000
(14:43 +0800)
Signed-off-by: Axel Lin <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
drivers/regulator/mc13xxx-regulator-core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/mc13xxx-regulator-core.c
b/drivers/regulator/mc13xxx-regulator-core.c
index 5d2ab2ea0c8caf5878615977cdc174c7883ad636..23cf9f9c383b557b7cb7119576c5618356addfc8 100644
(file)
--- 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;
}