From nobody Tue Dec 16 14:25:03 2025 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 2F07316F841; Tue, 27 May 2025 08:25:18 +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=1748334321; cv=none; b=XNXPMJdo4ORCNvm+kiOoEKlL3+jPtdZipekgYQQ34TPT5wyxT2r2fDVK7Ev+RwSBu/IQ5XP+Y2IWN5PmZ5wPc6jYsrXrQlUze8SsvI0hIfB1eMK6V+I1aK03/w8WEo0rKjb9CmSD4G7R1/Cpfkc9yJuTHoEFN+IMq9WotwRY2nQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748334321; c=relaxed/simple; bh=2lXgsHyitBH3vl8/oGOpJhgM0a0wjWZfp/xT88llvAU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qI06hviXd0iKCmAbUc1erD52oJlHAogIueXMpcN5IQeih9dFtLYIPfFtTxa77fGoqgtjimmF9POBMFtNkDu4imA875131kRR/WhplDr6PtvdrENQaurBESEtwjGcBYd25lsFZhVKDQlHA1qzt0IdlrsMOqItgcu8qRCBiZ6YiXE= 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: 1be07e0c3ad411f0b29709d653e92f7d-20250527 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:d92f471f-a90a-48cf-9ece-d16b7edd8a45,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:6493067,CLOUDID:ccf9f53adcad70a7c340a906c6d1460f,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: 1be07e0c3ad411f0b29709d653e92f7d-20250527 Received: from node4.com.cn [(10.44.16.170)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 974318342; Tue, 27 May 2025 16:25:12 +0800 Received: from node4.com.cn (localhost [127.0.0.1]) by node4.com.cn (NSMail) with SMTP id 124C916001F52; Tue, 27 May 2025 16:25:12 +0800 (CST) X-ns-mid: postfix-683576E7-8481202684 Received: from kylin-pc.. (unknown [172.25.130.133]) by node4.com.cn (NSMail) with ESMTPA id AC60716001F49; Tue, 27 May 2025 08:25:09 +0000 (UTC) From: Ai Chao To: perex@perex.cz, tiwai@suse.com, johannes@sipsolutions.net, kuninori.morimoto.gx@renesas.com, lgirdwood@gmail.com, broonie@kernel.org, jbrunet@baylibre.com, neil.armstrong@linaro.org, khilman@baylibre.com, martin.blumenstingl@googlemail.com, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, shawnguo@kernel.org, s.hauer@pengutronix.de, srinivas.kandagatla@linaro.org Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, imx@lists.linux.dev, kernel@pengutronix.de, linux-arm-msm@vger.kernel.org, Ai Chao Subject: [PATCH v3 2/6] ALSA: aoa: Use helper function for_each_child_of_node_scoped() Date: Tue, 27 May 2025 16:24:42 +0800 Message-ID: <20250527082446.2265500-3-aichao@kylinos.cn> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250527082446.2265500-1-aichao@kylinos.cn> References: <20250527082446.2265500-1-aichao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The for_each_child_of_node_scoped() helper provides a scope-based clean-up functionality to put the device_node automatically. Signed-off-by: Ai Chao --- sound/aoa/soundbus/i2sbus/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/c= ore.c index ce84288168e4..c1bd0565fc51 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -155,7 +155,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, struct device_node *np) { struct i2sbus_dev *dev; - struct device_node *child, *sound =3D NULL; + struct device_node *sound =3D NULL; struct resource *r; int i, layout =3D 0, rlen, ok =3D force; char node_name[8]; @@ -178,7 +178,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, return 0; =20 i =3D 0; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { if (of_node_name_eq(child, "sound")) { i++; sound =3D child; @@ -335,7 +335,6 @@ static int i2sbus_add_dev(struct macio_dev *macio, =20 static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *= match) { - struct device_node *np; int got =3D 0, err; struct i2sbus_control *control =3D NULL; =20 @@ -347,7 +346,7 @@ static int i2sbus_probe(struct macio_dev* dev, const st= ruct of_device_id *match) return -ENODEV; } =20 - 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 +=3D i2sbus_add_dev(dev, control, np); --=20 2.47.1