Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Qinglang Miao and committed by
Michael Ellerman
8f7e57e8 3a3181e1

+1 -2
+1 -2
drivers/macintosh/windfarm_smu_sat.c
··· 216 216 217 217 vsens[0] = vsens[1] = -1; 218 218 isens[0] = isens[1] = -1; 219 - child = NULL; 220 - while ((child = of_get_next_child(dev, child)) != NULL) { 219 + for_each_child_of_node(dev, child) { 221 220 reg = of_get_property(child, "reg", NULL); 222 221 loc = of_get_property(child, "location", NULL); 223 222 if (reg == NULL || loc == NULL)