public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ALSA: ppc: Switch to use for_each_child_of_node() macro
@ 2022-09-16 14:11 Yang Yingliang
  2022-09-17  8:01 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-09-16 14:11 UTC (permalink / raw)
  To: linux-kernel, alsa-devel; +Cc: perex, tiwai

Use for_each_child_of_node() macro instead of open coding it.
No functional change.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 sound/ppc/tumbler.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index c65e74d7cd0a..f3f8ad7c3df8 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1060,8 +1060,7 @@ static struct device_node *find_audio_device(const char *name)
 	if (! gpiop)
 		return NULL;
   
-	for (np = of_get_next_child(gpiop, NULL); np;
-			np = of_get_next_child(gpiop, np)) {
+	for_each_child_of_node(gpiop, np) {
 		const char *property = of_get_property(np, "audio-gpio", NULL);
 		if (property && strcmp(property, name) == 0)
 			break;
@@ -1080,8 +1079,7 @@ static struct device_node *find_compatible_audio_device(const char *name)
 	if (!gpiop)
 		return NULL;
   
-	for (np = of_get_next_child(gpiop, NULL); np;
-			np = of_get_next_child(gpiop, np)) {
+	for_each_child_of_node(gpiop, np) {
 		if (of_device_is_compatible(np, name))
 			break;
 	}  
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] ALSA: ppc: Switch to use for_each_child_of_node() macro
  2022-09-16 14:11 [PATCH -next] ALSA: ppc: Switch to use for_each_child_of_node() macro Yang Yingliang
@ 2022-09-17  8:01 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2022-09-17  8:01 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, alsa-devel, tiwai

On Fri, 16 Sep 2022 16:11:08 +0200,
Yang Yingliang wrote:
> 
> Use for_each_child_of_node() macro instead of open coding it.
> No functional change.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-17  8:02 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:11 [PATCH -next] ALSA: ppc: Switch to use for_each_child_of_node() macro Yang Yingliang
2022-09-17  8:01 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox