Commit 1d42e07e authored by Qinglang Miao's avatar Qinglang Miao Committed by Michael Ellerman

serial: pmac_zilog: use for_each_child_of_node() macro

Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: default avatarQinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200916062138.191188-1-miaoqinglang@huawei.com
parent acff5e6c
...@@ -1644,7 +1644,7 @@ static int __init pmz_probe(void) ...@@ -1644,7 +1644,7 @@ static int __init pmz_probe(void)
* TODO: Add routines with proper locking to do that... * TODO: Add routines with proper locking to do that...
*/ */
node_a = node_b = NULL; node_a = node_b = NULL;
for (np = NULL; (np = of_get_next_child(node_p, np)) != NULL;) { for_each_child_of_node(node_p, np) {
if (of_node_name_prefix(np, "ch-a")) if (of_node_name_prefix(np, "ch-a"))
node_a = of_node_get(np); node_a = of_node_get(np);
else if (of_node_name_prefix(np, "ch-b")) else if (of_node_name_prefix(np, "ch-b"))
......
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