* [PATCH -next] macintosh: Switch to use for_each_child_of_node() macro
@ 2022-09-16 14:16 Yang Yingliang
2022-11-30 9:23 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-09-16 14:16 UTC (permalink / raw)
To: linuxppc-dev
Use for_each_child_of_node() macro instead of open coding it.
No functional change.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/macintosh/windfarm_smu_controls.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index e9957ad49a2a..bdd92b27da2a 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -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);
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] macintosh: Switch to use for_each_child_of_node() macro
2022-09-16 14:16 [PATCH -next] macintosh: Switch to use for_each_child_of_node() macro Yang Yingliang
@ 2022-11-30 9:23 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-11-30 9:23 UTC (permalink / raw)
To: Yang Yingliang, linuxppc-dev
On Fri, 16 Sep 2022 22:16:38 +0800, Yang Yingliang wrote:
> Use for_each_child_of_node() macro instead of open coding it.
> No functional change.
>
>
Applied to powerpc/next.
[1/1] macintosh: Switch to use for_each_child_of_node() macro
https://git.kernel.org/powerpc/c/3aa16303dc98b7b8baa2adbc3210fd513ec0e810
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-30 9:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 14:16 [PATCH -next] macintosh: Switch to use for_each_child_of_node() macro Yang Yingliang
2022-11-30 9:23 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).