Skip to content

Commit

Permalink
macintosh: Use for_each_child_of_node() macro
Browse files Browse the repository at this point in the history
Use for_each_child_of_node() macro instead of open coding it.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
SamuelZOU authored and mpe committed May 4, 2022
1 parent 87ccc66 commit 6c1e560
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/macintosh/macio_asic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 6c1e560

Please sign in to comment.