From acff5e6c37fa4bf8d002c917a762c4f7615f6eaf Mon Sep 17 00:00:00 2001 From: Qinglang Miao Date: Wed, 16 Sep 2020 14:21:25 +0800 Subject: 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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200916062125.190729-1-miaoqinglang@huawei.com --- drivers/macintosh/windfarm_smu_sensors.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c index 3e6059eaa138..c8706cfb83fd 100644 --- a/drivers/macintosh/windfarm_smu_sensors.c +++ b/drivers/macintosh/windfarm_smu_sensors.c @@ -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; -- cgit v1.2.3