提交 6c1e5600 编写于 作者: Z Zou Wei 提交者: Michael Ellerman

macintosh: Use for_each_child_of_node() macro

Use for_each_child_of_node() macro instead of open coding it.
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NZou Wei <zou_wei@huawei.com>
Signed-off-by: NChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1623034908-30525-1-git-send-email-zou_wei@huawei.com
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册