ALSA: ppc: Switch to use for_each_child_of_node() macro

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

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220916141108.683080-1-yangyingliang@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Yang Yingliang 2022-09-16 22:11:08 +08:00 коммит произвёл Takashi Iwai
Родитель 39efc9c8a9
Коммит 7883017bbc
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -1060,8 +1060,7 @@ static struct device_node *find_audio_device(const char *name)
if (! gpiop) if (! gpiop)
return NULL; return NULL;
for (np = of_get_next_child(gpiop, NULL); np; for_each_child_of_node(gpiop, np) {
np = of_get_next_child(gpiop, np)) {
const char *property = of_get_property(np, "audio-gpio", NULL); const char *property = of_get_property(np, "audio-gpio", NULL);
if (property && strcmp(property, name) == 0) if (property && strcmp(property, name) == 0)
break; break;
@ -1080,8 +1079,7 @@ static struct device_node *find_compatible_audio_device(const char *name)
if (!gpiop) if (!gpiop)
return NULL; return NULL;
for (np = of_get_next_child(gpiop, NULL); np; for_each_child_of_node(gpiop, np) {
np = of_get_next_child(gpiop, np)) {
if (of_device_is_compatible(np, name)) if (of_device_is_compatible(np, name))
break; break;
} }