powerpc/pseries/dlpar: Use helper function for_each_child_of_node()
for_each_child_of_node can help to iterate through the device_node, and we don't need to use while loop. No functional change with this conversion. Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240822085430.25753-3-zhangzekun11@huawei.com
This commit is contained in:
committed by
Michael Ellerman
parent
197116e2de
commit
46f4bbb8aa
@@ -250,11 +250,8 @@ int dlpar_detach_node(struct device_node *dn)
|
||||
struct device_node *child;
|
||||
int rc;
|
||||
|
||||
child = of_get_next_child(dn, NULL);
|
||||
while (child) {
|
||||
for_each_child_of_node(dn, child)
|
||||
dlpar_detach_node(child);
|
||||
child = of_get_next_child(dn, child);
|
||||
}
|
||||
|
||||
rc = of_detach_node(dn);
|
||||
if (rc)
|
||||
|
||||
Reference in New Issue
Block a user