Skip to content

Commit

Permalink
macintosh: Switch to use for_each_child_of_node() macro
Browse files Browse the repository at this point in the history
Use for_each_child_of_node() macro instead of open coding it.
No functional change.

Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Yang Yingliang authored and mpe committed Nov 24, 2022
1 parent e3e528d commit 3aa1630
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/macintosh/windfarm_smu_controls.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,11 @@ static int __init smu_controls_init(void)
return -ENODEV;

/* Look for RPM fans */
for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;)
for_each_child_of_node(smu, fans)
if (of_node_name_eq(fans, "rpm-fans") ||
of_device_is_compatible(fans, "smu-rpm-fans"))
break;
for (fan = NULL;
fans && (fan = of_get_next_child(fans, fan)) != NULL;) {
for_each_child_of_node(fans, fan) {
struct smu_fan_control *fct;

fct = smu_fan_create(fan, 0);
Expand All @@ -286,11 +285,10 @@ static int __init smu_controls_init(void)


/* Look for PWM fans */
for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;)
for_each_child_of_node(smu, fans)
if (of_node_name_eq(fans, "pwm-fans"))
break;
for (fan = NULL;
fans && (fan = of_get_next_child(fans, fan)) != NULL;) {
for_each_child_of_node(fans, fan) {
struct smu_fan_control *fct;

fct = smu_fan_create(fan, 1);
Expand Down

0 comments on commit 3aa1630

Please sign in to comment.