]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: aoa: Use helper function for_each_child_of_node()
authorZhang Zekun <zhangzekun11@huawei.com>
Fri, 16 Aug 2024 02:18:26 +0000 (10:18 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 16 Aug 2024 07:52:42 +0000 (09:52 +0200)
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>
sound/aoa/soundbus/i2sbus/core.c

index 5431d2c49421067e0185158f9aa3e004f619c91e..ce84288168e45986171641f9e17e48443fd376eb 100644 (file)
@@ -335,7 +335,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 
 static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
 {
-       struct device_node *np = NULL;
+       struct device_node *np;
        int got = 0, err;
        struct i2sbus_control *control = NULL;
 
@@ -347,7 +347,7 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
                return -ENODEV;
        }
 
-       while ((np = of_get_next_child(dev->ofdev.dev.of_node, np))) {
+       for_each_child_of_node(dev->ofdev.dev.of_node, np) {
                if (of_device_is_compatible(np, "i2sbus") ||
                    of_device_is_compatible(np, "i2s-modem")) {
                        got += i2sbus_add_dev(dev, control, np);