diff options
author | Zou Wei <zou_wei@huawei.com> | 2021-06-07 05:01:48 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-05-04 11:37:46 +0200 |
commit | 6c1e5600b7c305fe2b7c4967c14c4d0cc5a13fae (patch) | |
tree | 426c5ed5610eeacd37bc6024798bce1e085a7d4d /drivers/macintosh | |
parent | powerpc/book3e: Fix sparse report in mm/nohash/fsl_book3e.c (diff) | |
download | linux-6c1e5600b7c305fe2b7c4967c14c4d0cc5a13fae.tar.xz linux-6c1e5600b7c305fe2b7c4967c14c4d0cc5a13fae.zip |
macintosh: Use for_each_child_of_node() macro
Use for_each_child_of_node() macro instead of open coding it.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1623034908-30525-1-git-send-email-zou_wei@huawei.com
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/macio_asic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 1943a007e2d5..6b025c8c7e57 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -472,7 +472,7 @@ static void macio_pci_add_devices(struct macio_chip *chip) root_res = &rdev->resource[0]; /* First scan 1st level */ - for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { + for_each_child_of_node(pnode, np) { if (macio_skip_device(np)) continue; of_node_get(np); @@ -489,7 +489,7 @@ static void macio_pci_add_devices(struct macio_chip *chip) /* Add media bay devices if any */ if (mbdev) { pnode = mbdev->ofdev.dev.of_node; - for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { + for_each_child_of_node(pnode, np) { if (macio_skip_device(np)) continue; of_node_get(np); @@ -502,7 +502,7 @@ static void macio_pci_add_devices(struct macio_chip *chip) /* Add serial ports if any */ if (sdev) { pnode = sdev->ofdev.dev.of_node; - for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { + for_each_child_of_node(pnode, np) { if (macio_skip_device(np)) continue; of_node_get(np); |