From patchwork Tue May 20 09:11:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ai Chao X-Patchwork-Id: 891358 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 198CC26739E; Tue, 20 May 2025 09:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747732320; cv=none; b=CAk6kBXVSWQ3zTIjc8SaJmdEeYOmDIRyNecBu8OcOUvGnxuQDbDA8LscHHEFnxAT5xFCRXa5E5MpyW1xE5hqY5rBaQNrKIxbZTrI3U7wG8wUzS3JpCLdAnhp+l+BgB2jj2k9dLrwOEHis9VN6vr+62n9KsBCx0AwWZeY0bjtEg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747732320; c=relaxed/simple; bh=GPav3Pqm9Ng7pwQWEz875jACXeJh8++mV+UVeB/+mTw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FQmda7rbZCd6mrLmzVLpx6cnSZtQri1068sDTP8xSoUsWr3+LH2WoD49cm3osIZHd+usjjfDrTJr6afZvMypQElv2flUf3n55DHvLhinVGy96H0CPARGUhT5lA1kve0HZoE6ITNMCNZZRP+vC4dnlL9veRK6wsmhND1EynbmCOw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 78003f30355a11f0b29709d653e92f7d-20250520 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45, REQID:43bd5a8b-3f0c-4b04-8e38-3a4c6068aaed, IP:0, U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:6493067, CLOUDID:24953480a3fe3af10c8b7045dbb8b953, BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:-3,IP: nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,L ES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 78003f30355a11f0b29709d653e92f7d-20250520 Received: from node4.com.cn [(10.44.16.170)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 696859959; Tue, 20 May 2025 17:11:52 +0800 Received: from node4.com.cn (localhost [127.0.0.1]) by node4.com.cn (NSMail) with SMTP id 3974916001CC7; Tue, 20 May 2025 17:11:52 +0800 (CST) X-ns-mid: postfix-682C4758-506861687 Received: from kylin-pc.. (unknown [172.25.130.133]) by node4.com.cn (NSMail) with ESMTPA id 279CA16001CC7; Tue, 20 May 2025 09:11:49 +0000 (UTC) From: Ai Chao To: johannes@sipsolutions.net, perex@perex.cz, tiwai@suse.com, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, jbrunet@baylibre.com, neil.armstrong@linaro.org, khilman@baylibre.com, martin.blumenstingl@googlemail.com, srinivas.kandagatla@linaro.org, kuninori.morimoto.gx@renesas.com, zhangzekun11@huawei.com, krzysztof.kozlowski@linaro.org, ckeepax@opensource.cirrus.com, drhodes@opensource.cirrus.com, alexey.klimov@linaro.org Cc: linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Ai Chao Subject: [PATCH 2/6] ASoC: aoa: Use helper function for_each_child_of_node_scoped() Date: Tue, 20 May 2025 17:11:27 +0800 Message-ID: <20250520091131.4150248-3-aichao@kylinos.cn> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250520091131.4150248-1-aichao@kylinos.cn> References: <20250520091131.4150248-1-aichao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The for_each_child_of_node_scoped() helper provides a scope-based clean-up functionality to put the device_node automatically, and as such, there is no need to call of_node_put() directly. Thus, use this helper to simplify the code. Signed-off-by: Ai Chao --- sound/aoa/soundbus/i2sbus/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index ce84288168e4..20a4c5891afc 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -207,6 +207,8 @@ static int i2sbus_add_dev(struct macio_dev *macio, } } } + of_node_put(sound); + /* for the time being, until we can handle non-layout-id * things in some fabric, refuse to attach if there is no * layout-id property or we haven't been forced to attach. @@ -335,7 +337,6 @@ 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; int got = 0, err; struct i2sbus_control *control = NULL; @@ -347,7 +348,7 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match) return -ENODEV; } - for_each_child_of_node(dev->ofdev.dev.of_node, np) { + for_each_child_of_node_scoped(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); From patchwork Tue May 20 09:11:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ai Chao X-Patchwork-Id: 891357 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7D2F268FD8; Tue, 20 May 2025 09:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747732326; cv=none; b=U3XL2Y89pxczD4ZQ7xssy5JQQLT0oulLqZ0bIaSnTTZLr0zU1aWSLmE1bQjkLKwUsasrR7bis3YtBlM32T4Wcr/T2tv8DZJvo5tNR8Cq5a6XkPT+16v7ynj8yCTYhCY7DA6FD0tQbUqAf2iddr4SboL54zph4f97HS95vXws/Fk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747732326; c=relaxed/simple; bh=vEg+O6ZQd8hBE/TqErQPF/ddUkaKC8kZak8okYcYbvQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zjpc8cC7HlngwVgp1B3K48JuKBItex9AUkGZ4HOUBiauKTduJgoMZ/MZzNGDQiP7REz81j2NmMPm/9oCmnnn+tKEVqx01PffNTYpuVtkFVSa3kb+DbRfe1T0X4TpJMRqKi503TE2PZUoSB1spFkU34SfDEYUL0nMuPglD3hbgAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 7c2d313a355a11f0b29709d653e92f7d-20250520 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45, REQID:0634e2b0-6be5-42ee-abbe-7876ece723fb, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6493067, CLOUDID:11e3fd52d48d5c05f7356116c988d80b, BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:-3,IP: nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,L ES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 7c2d313a355a11f0b29709d653e92f7d-20250520 Received: from node4.com.cn [(10.44.16.170)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1957821300; Tue, 20 May 2025 17:11:59 +0800 Received: from node4.com.cn (localhost [127.0.0.1]) by node4.com.cn (NSMail) with SMTP id 41D4F16003840; Tue, 20 May 2025 17:11:59 +0800 (CST) X-ns-mid: postfix-682C475F-939691689 Received: from kylin-pc.. (unknown [172.25.130.133]) by node4.com.cn (NSMail) with ESMTPA id 8659916001CC7; Tue, 20 May 2025 09:11:56 +0000 (UTC) From: Ai Chao To: johannes@sipsolutions.net, perex@perex.cz, tiwai@suse.com, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, jbrunet@baylibre.com, neil.armstrong@linaro.org, khilman@baylibre.com, martin.blumenstingl@googlemail.com, srinivas.kandagatla@linaro.org, kuninori.morimoto.gx@renesas.com, zhangzekun11@huawei.com, krzysztof.kozlowski@linaro.org, ckeepax@opensource.cirrus.com, drhodes@opensource.cirrus.com, alexey.klimov@linaro.org Cc: linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Ai Chao Subject: [PATCH 4/6] ASoC: meson: Use helper function for_each_child_of_node_scoped() Date: Tue, 20 May 2025 17:11:29 +0800 Message-ID: <20250520091131.4150248-5-aichao@kylinos.cn> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250520091131.4150248-1-aichao@kylinos.cn> References: <20250520091131.4150248-1-aichao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The for_each_child_of_node_scoped() helper provides a scope-based clean-up functionality to put the device_node automatically, and as such, there is no need to call of_node_put() directly. Thus, use this helper to simplify the code. Signed-off-by: Ai Chao --- sound/soc/meson/axg-card.c | 3 +-- sound/soc/meson/meson-card-utils.c | 14 ++++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index a2dfccb7990f..b4dca80e15e4 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -222,7 +222,6 @@ static int axg_card_parse_codecs_masks(struct snd_soc_card *card, struct axg_dai_link_tdm_data *be) { struct axg_dai_link_tdm_mask *codec_mask; - struct device_node *np; codec_mask = devm_kcalloc(card->dev, link->num_codecs, sizeof(*codec_mask), GFP_KERNEL); @@ -231,7 +230,7 @@ static int axg_card_parse_codecs_masks(struct snd_soc_card *card, be->codec_masks = codec_mask; - for_each_child_of_node(node, np) { + for_each_child_of_node_scoped(node, np) { snd_soc_of_get_slot_mask(np, "dai-tdm-slot-rx-mask", &codec_mask->rx); snd_soc_of_get_slot_mask(np, "dai-tdm-slot-tx-mask", diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c index cfc7f6e41ab5..cf08c8dedd91 100644 --- a/sound/soc/meson/meson-card-utils.c +++ b/sound/soc/meson/meson-card-utils.c @@ -137,7 +137,6 @@ int meson_card_set_be_link(struct snd_soc_card *card, struct device_node *node) { struct snd_soc_dai_link_component *codec; - struct device_node *np; int ret, num_codecs; num_codecs = of_get_child_count(node); @@ -154,12 +153,10 @@ int meson_card_set_be_link(struct snd_soc_card *card, link->codecs = codec; link->num_codecs = num_codecs; - for_each_child_of_node(node, np) { + for_each_child_of_node_scoped(node, np) { ret = meson_card_parse_dai(card, np, codec); - if (ret) { - of_node_put(np); + if (ret) return ret; - } codec++; } @@ -198,7 +195,6 @@ static int meson_card_add_links(struct snd_soc_card *card) { struct meson_card *priv = snd_soc_card_get_drvdata(card); struct device_node *node = card->dev->of_node; - struct device_node *np; int num, i, ret; num = of_get_child_count(node); @@ -212,12 +208,10 @@ static int meson_card_add_links(struct snd_soc_card *card) return ret; i = 0; - for_each_child_of_node(node, np) { + for_each_child_of_node_scoped(node, np) { ret = priv->match_data->add_link(card, np, &i); - if (ret) { - of_node_put(np); + if (ret) return ret; - } i++; } From patchwork Tue May 20 09:11:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ai Chao X-Patchwork-Id: 891356 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BABFC26A0C2; Tue, 20 May 2025 09:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747732335; cv=none; b=PUNKRXwbGjqKMXUZMaGUsKjpwaUvehiWK1LLATm81LUSnZq1WIGOkapl+PUMg+qDRNLanwOq4IhsRwy6bZvTTeHd4reIAqRH2V8Ht/Wo6RgUEayoOLt7JD2eLg/jkWn/n+teROJqycV4zvqdSk9M8/CMWTQbGleyKaX3HJKnJf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747732335; c=relaxed/simple; bh=mhhKRQs8P6BKh2PDytxh4uDgF6hxeldPRk98eetlmjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r9AeinGZYvlyRafxCl/fiSChQDkWIura/MBGAyoFPpiWnOePSISQql5iF4uk2Qiw/EsGncHoyqJyzkklZuqCSxiWR04hmF2YHCLVUCcPRIBUeBoMKe1zk1hVL0o5/o+lLppo8J0IyVCpRY8KZISHrjqjSPlUy3w5wSvEH33XB7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 80c4e580355a11f0b29709d653e92f7d-20250520 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45, REQID:c6c50a9b-851b-47c0-8a23-cef2bbc22566, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6493067, CLOUDID:d6772785fdb69d0add419fa33b60654c, BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:-3,IP: nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,L ES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 80c4e580355a11f0b29709d653e92f7d-20250520 Received: from node4.com.cn [(10.44.16.170)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1683691209; Tue, 20 May 2025 17:12:07 +0800 Received: from node4.com.cn (localhost [127.0.0.1]) by node4.com.cn (NSMail) with SMTP id E7D3A16003840; Tue, 20 May 2025 17:12:06 +0800 (CST) X-ns-mid: postfix-682C4766-7593491691 Received: from kylin-pc.. (unknown [172.25.130.133]) by node4.com.cn (NSMail) with ESMTPA id 3CA4216001CC7; Tue, 20 May 2025 09:12:04 +0000 (UTC) From: Ai Chao To: johannes@sipsolutions.net, perex@perex.cz, tiwai@suse.com, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, jbrunet@baylibre.com, neil.armstrong@linaro.org, khilman@baylibre.com, martin.blumenstingl@googlemail.com, srinivas.kandagatla@linaro.org, kuninori.morimoto.gx@renesas.com, zhangzekun11@huawei.com, krzysztof.kozlowski@linaro.org, ckeepax@opensource.cirrus.com, drhodes@opensource.cirrus.com, alexey.klimov@linaro.org Cc: linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Ai Chao Subject: [PATCH 6/6] ASoC: qcom: Use helper function for_each_child_of_node_scoped() Date: Tue, 20 May 2025 17:11:31 +0800 Message-ID: <20250520091131.4150248-7-aichao@kylinos.cn> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250520091131.4150248-1-aichao@kylinos.cn> References: <20250520091131.4150248-1-aichao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The for_each_child_of_node_scoped() helper provides a scope-based clean-up functionality to put the device_node automatically, and as such, there is no need to call of_node_put() directly. Thus, use this helper to simplify the code. Signed-off-by: Ai Chao --- sound/soc/qcom/lpass-cpu.c | 3 +-- sound/soc/qcom/qdsp6/q6afe-dai.c | 3 +-- sound/soc/qcom/qdsp6/q6asm-dai.c | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 242bc16da36d..62f49fe46273 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -1046,7 +1046,6 @@ static unsigned int of_lpass_cpu_parse_sd_lines(struct device *dev, static void of_lpass_cpu_parse_dai_data(struct device *dev, struct lpass_data *data) { - struct device_node *node; int ret, i, id; /* Allow all channels by default for backwards compatibility */ @@ -1056,7 +1055,7 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev, data->mi2s_capture_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH; } - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node_scoped(dev->of_node, node) { ret = of_property_read_u32(node, "reg", &id); if (ret || id < 0) { dev_err(dev, "valid dai id not found: %d\n", ret); diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index 7d9628cda875..64735f2adf8f 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -962,10 +962,9 @@ static const struct snd_soc_component_driver q6afe_dai_component = { static void of_q6afe_parse_dai_data(struct device *dev, struct q6afe_dai_data *data) { - struct device_node *node; int ret; - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node_scoped(dev->of_node, node) { unsigned int lines[Q6AFE_MAX_MI2S_LINES]; struct q6afe_dai_priv_data *priv; int id, i, num_lines; diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index a400c9a31fea..d7680dd3a3bb 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -1236,10 +1236,8 @@ static int of_q6asm_parse_dai_data(struct device *dev, { struct snd_soc_dai_driver *dai_drv; struct snd_soc_pcm_stream empty_stream; - struct device_node *node; int ret, id, dir, idx = 0; - pdata->num_dais = of_get_child_count(dev->of_node); if (!pdata->num_dais) { dev_err(dev, "No dais found in DT\n"); @@ -1253,7 +1251,7 @@ static int of_q6asm_parse_dai_data(struct device *dev, memset(&empty_stream, 0, sizeof(empty_stream)); - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node_scoped(dev->of_node, node) { ret = of_property_read_u32(node, "reg", &id); if (ret || id >= MAX_SESSIONS || id < 0) { dev_err(dev, "valid dai id not found:%d\n", ret);