macintosh: smu_sensors: use for_each_child_of_node() macro

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
This commit is contained in:
Qinglang Miao 2020-09-16 14:21:25 +08:00 committed by Michael Ellerman
parent 9c826d31a7
commit acff5e6c37

View 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;