mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 14:44:10 +08:00
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
This commit is contained in:
parent
3a3181e16f
commit
8f7e57e8e2
@ -216,8 +216,7 @@ static int wf_sat_probe(struct i2c_client *client,
|
|||||||
|
|
||||||
vsens[0] = vsens[1] = -1;
|
vsens[0] = vsens[1] = -1;
|
||||||
isens[0] = isens[1] = -1;
|
isens[0] = isens[1] = -1;
|
||||||
child = NULL;
|
for_each_child_of_node(dev, child) {
|
||||||
while ((child = of_get_next_child(dev, child)) != NULL) {
|
|
||||||
reg = of_get_property(child, "reg", NULL);
|
reg = of_get_property(child, "reg", NULL);
|
||||||
loc = of_get_property(child, "location", NULL);
|
loc = of_get_property(child, "location", NULL);
|
||||||
if (reg == NULL || loc == NULL)
|
if (reg == NULL || loc == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user