summaryrefslogtreecommitdiff
path: root/drivers/macintosh/windfarm_smu_sat.c
diff options
context:
space:
mode:
authorQinglang Miao <miaoqinglang@huawei.com>2020-09-14 09:14:11 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2020-09-15 15:13:39 +0300
commit8f7e57e8e29c4fc788811dd4db96126272b8df91 (patch)
tree01966548b3c51a4624a73cedaf831cc1b2c74c82 /drivers/macintosh/windfarm_smu_sat.c
parent3a3181e16fbde752007759f8759d25e0ff1fc425 (diff)
downloadlinux-8f7e57e8e29c4fc788811dd4db96126272b8df91.tar.xz
macintosh: windfarm: use for_each_child_of_node() macro
Use for_each_child_of_node() macro instead of open coding it. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200914061411.3356-1-miaoqinglang@huawei.com
Diffstat (limited to 'drivers/macintosh/windfarm_smu_sat.c')
-rw-r--r--drivers/macintosh/windfarm_smu_sat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index cb75dc035616..e46e1153a0b4 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -216,8 +216,7 @@ static int wf_sat_probe(struct i2c_client *client,
vsens[0] = vsens[1] = -1;
isens[0] = isens[1] = -1;
- child = NULL;
- while ((child = of_get_next_child(dev, child)) != NULL) {
+ for_each_child_of_node(dev, child) {
reg = of_get_property(child, "reg", NULL);
loc = of_get_property(child, "location", NULL);
if (reg == NULL || loc == NULL)