macintosh: smu_sensors: use for_each_child_of_node() macro
authorQinglang Miao <miaoqinglang@huawei.com>
Wed, 16 Sep 2020 06:21:25 +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/20200916062125.190729-1-miaoqinglang@huawei.com
drivers/macintosh/windfarm_smu_sensors.c

index 3e6059e..c8706cf 100644 (file)
@@ -421,8 +421,7 @@ static int __init smu_sensors_init(void)
                return -ENODEV;
 
        /* Look for sensors subdir */
-       for (sensors = NULL;
-            (sensors = of_get_next_child(smu, sensors)) != NULL;)
+       for_each_child_of_node(smu, sensors)
                if (of_node_name_eq(sensors, "sensors"))
                        break;