mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
regulator: mc13xxx: Use of_get_child_count()
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
ee70b25849
commit
86f6673325
1 changed files with 3 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue