Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: aoa: Use helper function for_each_child_of_node()

for_each_child_of_node can help to iterate through the device_node,
and we don't need to use while loop. No functional change with this
conversion.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Link: https://patch.msgid.link/20240816021826.65190-1-zhangzekun11@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Zhang Zekun and committed by
Takashi Iwai
d32cf9fb d79e13f8

+2 -2
+2 -2
sound/aoa/soundbus/i2sbus/core.c
··· 335 335 336 336 static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match) 337 337 { 338 - struct device_node *np = NULL; 338 + struct device_node *np; 339 339 int got = 0, err; 340 340 struct i2sbus_control *control = NULL; 341 341 ··· 347 347 return -ENODEV; 348 348 } 349 349 350 - while ((np = of_get_next_child(dev->ofdev.dev.of_node, np))) { 350 + for_each_child_of_node(dev->ofdev.dev.of_node, np) { 351 351 if (of_device_is_compatible(np, "i2sbus") || 352 352 of_device_is_compatible(np, "i2s-modem")) { 353 353 got += i2sbus_add_dev(dev, control, np);