OSDN Git Service

powerpc/powermac: of_node_put() is not needed after iterator
authorzhong jiang <zhongjiang@huawei.com>
Sat, 4 Aug 2018 14:25:00 +0000 (22:25 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Aug 2018 14:32:34 +0000 (00:32 +1000)
for_each_node_by_name() iterators only exit normally when the loop
cursor is NULL, So there is no need to call of_node_put().

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powermac/feature.c

index 3f82cb2..4eb8cb3 100644 (file)
@@ -2889,10 +2889,8 @@ set_initial_features(void)
        /* On all machines, switch modem & serial ports off */
        for_each_node_by_name(np, "ch-a")
                initial_serial_shutdown(np);
-       of_node_put(np);
        for_each_node_by_name(np, "ch-b")
                initial_serial_shutdown(np);
-       of_node_put(np);
 }
 
 void __init