serial: pmac_zilog: use for_each_child_of_node() macro
authorQinglang Miao <miaoqinglang@huawei.com>
Wed, 16 Sep 2020 06:21:38 +0000 (14:21 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 18 Sep 2020 09:59:44 +0000 (19:59 +1000)
Use for_each_child_of_node() macro instead of open coding it.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200916062138.191188-1-miaoqinglang@huawei.com
drivers/tty/serial/pmac_zilog.c

index 96e7aa479961c16c3733f42997d27309fc3b7d49..063484b22523a55a9bf4e2e84ef8ae712b7f6479 100644 (file)
@@ -1644,7 +1644,7 @@ static int __init pmz_probe(void)
                 * TODO: Add routines with proper locking to do that...
                 */
                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"))
                                node_a = of_node_get(np);
                        else if (of_node_name_prefix(np, "ch-b"))