From patchwork Thu May 22 05:02:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ai Chao X-Patchwork-Id: 891989 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 75469288CC; Thu, 22 May 2025 05:03:24 +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=1747890207; cv=none; b=JAchRO2sgEjQVn4JjdUn6h0Ak0Q/SM6hsV6jw+ifr6wzcd89d161qhUkqoaMb1iKzps/m6tHWKbDqj3pLW0EmtCBM8eEY8j/WmB0LL6bjo1otJm2yYy+rfY1hFtArJ8yP+NEfy+H2FVbfTTC0O7vY7UBhD++qcXqW03kKuiqzL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747890207; c=relaxed/simple; bh=8it8DcLAcMd9yJVwUvKvFf4a7Jf2S2WgE8Gao82xrWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZEIhEyZoNYuy86kQ7B2axmo6OcSz+t/amSghwZuBFNG0K0C0P478VKqPf/wNu1CUKTn+xxGtNo5rGtwya+LntP1R1kGcMyUnRl9nONhD8iffT6YBxlsr5VNNf7kwOtJAYG2lDhgzT+BB20ZfX7uccluqZIGyscLBNsk56dxTf0A= 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: 13b121b836ca11f0b29709d653e92f7d-20250522 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45, REQID:5fbbc8a6-807d-41c9-865c-38a919df50b3, 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:abe1f6f7f10277015de05c960ee79130, 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: 13b121b836ca11f0b29709d653e92f7d-20250522 Received: from node4.com.cn [(10.44.16.170)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1939899590; Thu, 22 May 2025 13:03:19 +0800 Received: from node4.com.cn (localhost [127.0.0.1]) by node4.com.cn (NSMail) with SMTP id BBCBC16003840; Thu, 22 May 2025 13:03:18 +0800 (CST) X-ns-mid: postfix-682EB016-60117729 Received: from kylin-pc.. (unknown [172.25.130.133]) by node4.com.cn (NSMail) with ESMTPA id 27C1116001CC7; Thu, 22 May 2025 05:03:15 +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 v2 1/6] ASoC: ppc: Use helper function for_each_child_of_node_scoped() Date: Thu, 22 May 2025 13:02:54 +0800 Message-ID: <20250522050300.519244-2-aichao@kylinos.cn> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250522050300.519244-1-aichao@kylinos.cn> References: <20250522050300.519244-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/ppc/tumbler.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 3c09660e1522..b81d0789b9fb 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -1343,7 +1343,7 @@ int snd_pmac_tumbler_init(struct snd_pmac *chip) int i, err; struct pmac_tumbler *mix; const u32 *paddr; - struct device_node *tas_node, *np; + struct device_node *tas_node; char *chipname; request_module("i2c-powermac"); @@ -1358,13 +1358,12 @@ int snd_pmac_tumbler_init(struct snd_pmac *chip) mix->anded_reset = 0; mix->reset_on_sleep = 1; - for_each_child_of_node(chip->node, np) { + for_each_child_of_node_scoped(chip->node, np) { if (of_node_name_eq(np, "sound")) { if (of_property_read_bool(np, "has-anded-reset")) mix->anded_reset = 1; if (of_property_present(np, "layout-id")) mix->reset_on_sleep = 0; - of_node_put(np); break; } }