Commit 6c1e5600 authored by Zou Wei's avatar Zou Wei Committed by Michael Ellerman

macintosh: Use for_each_child_of_node() macro

Use for_each_child_of_node() macro instead of open coding it.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1623034908-30525-1-git-send-email-zou_wei@huawei.com
parent 87ccc668
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment