From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9A8DC5AD49 for ; Tue, 3 Jun 2025 05:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GSvXT2FpamZIcL3RYxWnzHbzVjkhXDHonD8xNV3/oKA=; b=kADPlqueIQ5yIv mwkyxjX+tsOVAymLmmHIqx4lejFeOBY9InVl+EDyEM3ovDDwZcfXO078/ikaKiz7/jIH7zS/c8pyB 7gL94b10ACBVyGEEokhkEl63rtsIkG1UFuB3VRkf/e6/XVHZH4s/a898gHo693nQALvwWX3kchg/9 XjByc5I07XJN8oG6z+5EFRZHkQBt8v/I1BAoH/8i219nt0CWkjAqqhZLNIO5IqX1NrSms+WotVuga m8C2gCFdA4oQspl+XFJpN2TirE42Pn1p1c9v4vsDkBiUJUvXW3Vdm94ebBGgRZWJ+KtlBERNRMTtN ucpo8V1jfO+sQINClTMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMKf9-00000009sfg-374e; Tue, 03 Jun 2025 05:58:15 +0000 Received: from mailgw.kylinos.cn ([124.126.103.232]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMKYf-00000009rTV-1CXr; Tue, 03 Jun 2025 05:51:35 +0000 X-UUID: c6c64288403e11f0b29709d653e92f7d-20250603 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:2fd0565f-3054-47c2-a3c7-33ac47588001,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:a4388713d63cb4b1e886bed20fbf95f3,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: c6c64288403e11f0b29709d653e92f7d-20250603 Received: from node4.com.cn [(10.44.16.170)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1836277498; Tue, 03 Jun 2025 13:51:21 +0800 Received: from node4.com.cn (localhost [127.0.0.1]) by node4.com.cn (NSMail) with SMTP id 4A8BC16001CC7; Tue, 3 Jun 2025 13:51:21 +0800 (CST) X-ns-mid: postfix-683E8D59-13836574 Received: from kylin-pc.. (unknown [172.25.130.133]) by node4.com.cn (NSMail) with ESMTPA id 14BEB16001A05; Tue, 3 Jun 2025 05:51:18 +0000 (UTC) From: Ai Chao To: perex@perex.cz, tiwai@suse.com, 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, kernel@pengutronix.de Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Ai Chao Subject: [PATCH v4 1/4] ALSA: ppc: Use helper function for_each_child_of_node_scoped() Date: Tue, 3 Jun 2025 13:51:06 +0800 Message-ID: <20250603055109.3154061-2-aichao@kylinos.cn> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250603055109.3154061-1-aichao@kylinos.cn> References: <20250603055109.3154061-1-aichao@kylinos.cn> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250602_225133_669193_8BDACBCE X-CRM114-Status: UNSURE ( 7.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org 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. 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; } } -- 2.47.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic