summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorZhang Zekun <zhangzekun11@huawei.com>2024-08-22 11:54:30 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2024-08-29 15:30:35 +0300
commit46f4bbb8aac2b876355cdefdacd1971b65f8b631 (patch)
tree39ae8ae8d4586af9eb7f594aa99a2e1e7deb0d2d /arch/powerpc/platforms
parent197116e2dec8d23888ce76044fe673480afceff0 (diff)
downloadlinux-46f4bbb8aac2b876355cdefdacd1971b65f8b631.tar.xz
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
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/dlpar.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 47f8eabd1bee..ee47ed21b99d 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -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)