From nobody Fri Dec 19 15:16:28 2025 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 2E54113F45F for ; Mon, 26 Aug 2024 08:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660463; cv=none; b=omEY+CrLMfyDW+hlCTEe92WSg4JbypNKth6x47l8RM8T0pbBYMFi1mPsyaS+DyTm5+lE96lhxGkO0jwsW5r4OV2911lh1kDAQ8Yb0IN6w+4gZJhYAzryhtOc4dTlm6CQf/x3uoOH6/SCVOTRhR5LbSsqGTywZdBKyMFpXIgvzDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660463; c=relaxed/simple; bh=nYyO6LwgVFzXt2p7i0oGLkc8P1po82g1BGlszDnuFBo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qqmXdeVpeIsxRD70gwSLn2KEaeWeLRTXjdHGZ+oJDM94ID9cronP4N6CkFF8hhVMEytZ5H3ekPNvnxx7ASX3CqaFPeovLsaLMsNAbhZX+onlvcuRt4vpcJxQxGYtpuslbOtRc4zn5mWM/O7h6hhQPKi8A5LnhC66KQt0TWw9F50= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WskBQ14dKz14Dk8; Mon, 26 Aug 2024 16:20:14 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 8872714037E; Mon, 26 Aug 2024 16:20:59 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:20:59 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 01/12] mfd: max77620: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:36 +0800 Message-ID: <20240826082847.2591036-2-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mfd/max77620.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index 74ef3f6d576c..89b30ef91f4f 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -400,7 +400,7 @@ static int max77620_config_fps(struct max77620_chip *ch= ip, static int max77620_initialise_fps(struct max77620_chip *chip) { struct device *dev =3D chip->dev; - struct device_node *fps_np, *fps_child; + struct device_node *fps_np; u8 config; int fps_id; int ret; @@ -414,10 +414,9 @@ static int max77620_initialise_fps(struct max77620_chi= p *chip) if (!fps_np) goto skip_fps; =20 - for_each_child_of_node(fps_np, fps_child) { + for_each_child_of_node_scoped(fps_np, fps_child) { ret =3D max77620_config_fps(chip, fps_child); if (ret < 0) { - of_node_put(fps_child); of_node_put(fps_np); return ret; } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 2865B13E8B6 for ; Mon, 26 Aug 2024 08:21:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660464; cv=none; b=Q8ZwAuRJ3tsiKZyBDi5suWbZfITwEavbBAKIVhgzd3Qv9HHtW4rU7tUEL2c20OYhOtdMiUjD5TJ1h8HhnAWHld37r0ekWVa/mUy19FXVHAJ1SGRtR1WolH6NdRkPnGP+381clS0JBDarPAEGUmyxt7sftZglC92ovPDhltm7B5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660464; c=relaxed/simple; bh=Mr9hCNs+O49bH0NxD/PEQrOYFZjoMdWusHz8GwZ6rQo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t2H0SPp2Soi3jJg3/2h62G5jhE8vU1MxPTiO2ubzaomFtyP0pAtlabQWErsyPVrnTNKB8H3Yn6A2lt6k5q/xm5qt3EWuAIJtx0bdFiQQ2RZQZnX1HuQny7hk/7LEjfdtDiuhoJwSLb4IIvxBbVedAoJVU8z7P3+SqfvzTTbGpu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Wsk5m36qKz69Lg; Mon, 26 Aug 2024 16:16:12 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id DE81014037E; Mon, 26 Aug 2024 16:20:59 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:20:59 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 02/12] mfd: qcom-spmi-pmic: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:37 +0800 Message-ID: <20240826082847.2591036-3-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mfd/qcom-spmi-pmic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c index eab5bf6cff10..b4b178caf754 100644 --- a/drivers/mfd/qcom-spmi-pmic.c +++ b/drivers/mfd/qcom-spmi-pmic.c @@ -84,7 +84,6 @@ static const struct of_device_id pmic_spmi_id_table[] =3D= { static struct spmi_device *qcom_pmic_get_base_usid(struct spmi_device *sde= v, struct qcom_spmi_dev *ctx) { struct device_node *spmi_bus; - struct device_node *child; int function_parent_usid, ret; u32 pmic_addr; =20 @@ -108,10 +107,9 @@ static struct spmi_device *qcom_pmic_get_base_usid(str= uct spmi_device *sdev, str */ spmi_bus =3D of_get_parent(sdev->dev.of_node); sdev =3D ERR_PTR(-ENODATA); - for_each_child_of_node(spmi_bus, child) { + for_each_child_of_node_scoped(spmi_bus, child) { ret =3D of_property_read_u32_index(child, "reg", 0, &pmic_addr); if (ret) { - of_node_put(child); sdev =3D ERR_PTR(ret); break; } @@ -125,7 +123,6 @@ static struct spmi_device *qcom_pmic_get_base_usid(stru= ct spmi_device *sdev, str */ sdev =3D ERR_PTR(-EPROBE_DEFER); } - of_node_put(child); break; } } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 2E50013F458 for ; Mon, 26 Aug 2024 08:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660464; cv=none; b=jy46/Fe/nseBZGcNdvytg2G0MB2OIcIk3wNllV3+MOVqpeLNf5rVFV4tDU9/kPyAEhyDqFZ0GZnRbasNonwReKRt/CtkJTz3z4+qWibb5Kan+YLK18rQl3FnBgGovwnvbN09qqkzEw8LEL3UOE9f6o6L7GAMRZdViEcjzZVvf/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660464; c=relaxed/simple; bh=0EPYh1Vzx06q4ro7t88k1WvU2Ig0NleU9/qKXX5YAU4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bo8dKdVQGhsRbO9K7RdyYMQan2Xo6eQTxPRZj0Z85O+jLldAg2svaRSPjyaNK0QcVEwZ7GxBsL2w/mZ0d2nQhRO0eN2frvvmFlEAa3EvoOrWqJMEaauka/T1LPWPqtbC6v7MMPzhzmXhanpJo7BimFnhtB3r2d7GM+2nH+Cka2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WskBQ5Ybyz14Dr6; Mon, 26 Aug 2024 16:20:14 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 2E661140120; Mon, 26 Aug 2024 16:21:00 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:20:59 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 03/12] mtd: rawnand: arasan: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:38 +0800 Message-ID: <20240826082847.2591036-4-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/arasan-nand-controller.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/arasan-nand-controller.c b/drivers/mtd/na= nd/raw/arasan-nand-controller.c index 2ff1d2b13e3c..5436ec4a8fde 100644 --- a/drivers/mtd/nand/raw/arasan-nand-controller.c +++ b/drivers/mtd/nand/raw/arasan-nand-controller.c @@ -1360,7 +1360,7 @@ static void anfc_chips_cleanup(struct arasan_nfc *nfc) =20 static int anfc_chips_init(struct arasan_nfc *nfc) { - struct device_node *np =3D nfc->dev->of_node, *nand_np; + struct device_node *np =3D nfc->dev->of_node; int nchips =3D of_get_child_count(np); int ret; =20 @@ -1370,10 +1370,9 @@ static int anfc_chips_init(struct arasan_nfc *nfc) return -EINVAL; } =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D anfc_chip_init(nfc, nand_np); if (ret) { - of_node_put(nand_np); anfc_chips_cleanup(nfc); break; } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 B332B140E29 for ; Mon, 26 Aug 2024 08:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660464; cv=none; b=gk+fHaoDfP7hnal+wuxAFrqeieGSMDdnixBtSgpA79L8GSdsgZVTD1cYerIsrx3ivGdTu1UMd5OVl8d9fgZ+iRgZHri1AGYfPN3/GIxSiJ9XT7reZ+9prdQTW2NfvAn8REWm97MfZZO9tcjd7ejljmzHInXcuUH4XejUa3RTIqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660464; c=relaxed/simple; bh=df5D92/twkTlA+QLMEAQkUMWu59nT3h+JvEl8ZoQRgU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bvTrTTYEDjfUlDNs1UzQ/uE7NIqsSv8B3qfx8PFjvdsmxLXSuhU3a1r8fksdLg14d92vzqMEnpDxoCZOofI3rh70MGfch5y1f9FpDj7fsJTF097vA0EisMcJh59eIm+wK6JEzhsu+kb/Znz54r/RIPJ6aOE+KjjbDGtDhS1nSfM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WskBR0rGcz14GKW; Mon, 26 Aug 2024 16:20:15 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 7DF5818006C; Mon, 26 Aug 2024 16:21:00 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:00 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 04/12] mtd: rawnand: cadence: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:39 +0800 Message-ID: <20240826082847.2591036-5-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop by using for_each_child_of_node_scoped(). Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/cadence-nand-controller.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/n= and/raw/cadence-nand-controller.c index ff92c17def83..3bc89b356963 100644 --- a/drivers/mtd/nand/raw/cadence-nand-controller.c +++ b/drivers/mtd/nand/raw/cadence-nand-controller.c @@ -2836,7 +2836,6 @@ static void cadence_nand_chips_cleanup(struct cdns_na= nd_ctrl *cdns_ctrl) static int cadence_nand_chips_init(struct cdns_nand_ctrl *cdns_ctrl) { struct device_node *np =3D cdns_ctrl->dev->of_node; - struct device_node *nand_np; int max_cs =3D cdns_ctrl->caps2.max_banks; int nchips, ret; =20 @@ -2849,10 +2848,9 @@ static int cadence_nand_chips_init(struct cdns_nand_= ctrl *cdns_ctrl) return -EINVAL; } =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D cadence_nand_chip_init(cdns_ctrl, nand_np); if (ret) { - of_node_put(nand_np); cadence_nand_chips_cleanup(cdns_ctrl); return ret; } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 1DAB813E3E1 for ; Mon, 26 Aug 2024 08:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660465; cv=none; b=dAo6wLDR6sYwsmrR+r7mU3Fwb+qLwi/PwR0i+qQB3DX96bDVYFNwpW4h1LHy1v2CoU6CUKEGtZ6u7odiSAbbQyxh4Esoz85hzyrXOU6ShZM0CZkFUsw4i/j9QFtR8hzJgE0nW4O7EPwA0AOComAT51kPdaQRXTAL3Z05urIlzbY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660465; c=relaxed/simple; bh=uRAT0GszZ+0lWEUNjajcbWLsbtL+79a2PZ6UcNhAviw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TG+h/OK29G+nWZKXJIhAj2xu+bHViPmDtWoolI3Wo7FDri3JLa1j6qWUbKnkdm+dHdoUaUrlIcD7kJB1MGKkyiCvYHjAyKYMDPRk+IjQScdYt5qyvFzfpdhLBPN8YeSk7i6DOHRCPjCoO1gWkx4WjIYPmAAf4mPNuhgyfmlXSAI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WskC74Zc2z1S8wS; Mon, 26 Aug 2024 16:20:51 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id CCF72140135; Mon, 26 Aug 2024 16:21:00 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:00 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 05/12] mtd: rawnand: pl353: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:40 +0800 Message-ID: <20240826082847.2591036-6-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop by using for_each_child_of_node_scoped(). Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/pl35x-nand-controller.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nan= d/raw/pl35x-nand-controller.c index 1c76ee98efb7..2570fd0beea0 100644 --- a/drivers/mtd/nand/raw/pl35x-nand-controller.c +++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c @@ -1111,7 +1111,7 @@ static void pl35x_nand_chips_cleanup(struct pl35x_nan= dc *nfc) =20 static int pl35x_nand_chips_init(struct pl35x_nandc *nfc) { - struct device_node *np =3D nfc->dev->of_node, *nand_np; + struct device_node *np =3D nfc->dev->of_node; int nchips =3D of_get_child_count(np); int ret; =20 @@ -1121,10 +1121,9 @@ static int pl35x_nand_chips_init(struct pl35x_nandc = *nfc) return -EINVAL; } =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D pl35x_nand_chip_init(nfc, nand_np); if (ret) { - of_node_put(nand_np); pl35x_nand_chips_cleanup(nfc); break; } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 6002413F01A for ; Mon, 26 Aug 2024 08:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; cv=none; b=uqPfyODpnBCtEDLRCxLjGttUJ6ilr2DCypFYHVaIZ/BgJXI0zkQwN39iT0U8jq2J+CjMs6b/nVUObzjfOv0qXM3MGYLitOQVgLCOPPUInEU7TQU7s/3jK1D0bQQ9tucJnNBopPWnzn+iJU3l6Uobp6ZvOr/zeBVoOs/FBeB5Vdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; c=relaxed/simple; bh=BizNWYM6Kr4faisHfJ7LjecVmx3Bm/gbwgObz66plVQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jUGO8tbDGji4hnY6eiWozIKFnkQgtM8p+Q4vnG9/4qDW2HrZhevPIChUpSmt5rQ3UaYFIgmdyIWoIMwM+phDGsiX2y0OD4INspmoJED+nAAZdmzJT3B27Lce/YwqVxqAjaprH0kKpg26yfsfzg8TAOtq4cXH/ujX5yvwbXJVSRk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WskC858g7z1j6NG; Mon, 26 Aug 2024 16:20:52 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 258891A016C; Mon, 26 Aug 2024 16:21:01 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:00 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 06/12] mtd: rawnand: marvell: drm/rockchip: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:41 +0800 Message-ID: <20240826082847.2591036-7-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/marvell_nand.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/mar= vell_nand.c index 5b0f5a9cef81..26648b72e691 100644 --- a/drivers/mtd/nand/raw/marvell_nand.c +++ b/drivers/mtd/nand/raw/marvell_nand.c @@ -2771,7 +2771,6 @@ static void marvell_nand_chips_cleanup(struct marvell= _nfc *nfc) static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc = *nfc) { struct device_node *np =3D dev->of_node; - struct device_node *nand_np; int max_cs =3D nfc->caps->max_cs_nb; int nchips; int ret; @@ -2798,20 +2797,15 @@ static int marvell_nand_chips_init(struct device *d= ev, struct marvell_nfc *nfc) return ret; } =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D marvell_nand_chip_init(dev, nfc, nand_np); if (ret) { - of_node_put(nand_np); - goto cleanup_chips; + marvell_nand_chips_cleanup(nfc); + return ret; } } =20 return 0; - -cleanup_chips: - marvell_nand_chips_cleanup(nfc); - - return ret; } =20 static int marvell_nfc_init_dma(struct marvell_nfc *nfc) --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 AEFC514386B for ; Mon, 26 Aug 2024 08:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660465; cv=none; b=LcnkJBUKcKEuagNM5NShDLFgKNM7KfbJjnm2WGQbLnqNtzJoWhUXrXHCCRhepZYxvchjaDFyFoRkYadLij7RvlaehvB/VJHu36G1v2AmRQuzyQtEHKFdibsDDqXyLAHXGYaheyGAs/WlT0TpinmmnxU4/Ggx5LQG6dRNXwFQCeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660465; c=relaxed/simple; bh=Bna+vE5Iar1jNNPPNrHpaEB+yTpBYOu6fQ9VwwXdTRk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JrCWUD34b9Vf4rs9Z64jS3HyBB0dDrCcXlkAWgNL6jhopkC8VuuTrG2uvBGy4TVW61W4FcZJSS1WVzZM6t1yELQM9xmK8QGAEXFCJGHfOzT4Ti77X3N1hLIQa6Xz3r19Mefc4mo8pydcQshqN+3773TDlclsIFVt7c/2iQFvyWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WskC90MS7z1j7Gg; Mon, 26 Aug 2024 16:20:53 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 742A8140135; Mon, 26 Aug 2024 16:21:01 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:00 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 07/12] mtd: rawnand: rockchip: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:42 +0800 Message-ID: <20240826082847.2591036-8-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/rockchip-nand-controller.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/= nand/raw/rockchip-nand-controller.c index 55580447633b..51c9cf9013dc 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -1211,7 +1211,7 @@ static void rk_nfc_chips_cleanup(struct rk_nfc *nfc) =20 static int rk_nfc_nand_chips_init(struct device *dev, struct rk_nfc *nfc) { - struct device_node *np =3D dev->of_node, *nand_np; + struct device_node *np =3D dev->of_node; int nchips =3D of_get_child_count(np); int ret; =20 @@ -1221,10 +1221,9 @@ static int rk_nfc_nand_chips_init(struct device *dev= , struct rk_nfc *nfc) return -EINVAL; } =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D rk_nfc_nand_chip_init(dev, nfc, nand_np); if (ret) { - of_node_put(nand_np); rk_nfc_chips_cleanup(nfc); return ret; } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (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 15D3E14430E for ; Mon, 26 Aug 2024 08:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660465; cv=none; b=gGHIpyGHLrvQegdK7iMVtluGurcgdHARiKoIXi6azESV0Ccx7LAyBuPfA50pyUKK6UunLITlNu7Ys9uEZC9AitgThN1aYeMS9h0xcpg7mI0R6TAdy5YA8rtYqzqJOgqNvvHo7gl1/YFYUOe6NyLRvqpjGwz7itBVFDCxAIwu7Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660465; c=relaxed/simple; bh=CFXwQtaRxFYcIiQIJWllgwYc8dBwaJAt5TRD2jKy+yg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VwJAJmy1h4CSgJttiUnHN7esPstA2R6EtXT5lJ4VczijipL+jo0yU89139FW4Dbsaq207cGAS99bQYZrpwqh/+I9QiDsC7q3oGK7gsh7LdrJjvEHa7IlFt9L97StzoTU6fmA0AfudrjakZrOTeRyt2G4/xYbku5RIICiFCta58Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4WskC91Hfpz2CnbF; Mon, 26 Aug 2024 16:20:53 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id C1D1E1A0188; Mon, 26 Aug 2024 16:21:01 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:01 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 08/12] mtd: rawnand: meson: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:43 +0800 Message-ID: <20240826082847.2591036-9-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/meson_nand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson= _nand.c index 9eb5470344d0..8806a06462ac 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1495,14 +1495,12 @@ static int meson_nfc_nand_chips_init(struct device = *dev, struct meson_nfc *nfc) { struct device_node *np =3D dev->of_node; - struct device_node *nand_np; int ret; =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D meson_nfc_nand_chip_init(dev, nfc, nand_np); if (ret) { meson_nfc_nand_chip_cleanup(nfc); - of_node_put(nand_np); return ret; } } --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 2C4E0154458 for ; Mon, 26 Aug 2024 08:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; cv=none; b=k29kNMe3zvyIE/GD29VMC/gkoD/n2/adiIb3ukV1cC/6KL7SxF2kv2EsELPtu+9HoI1bGIel+nvIaLUDWC18lxTIb8pdv152ACeNqIdwqp6S9bk+kRKOlZfOcorSUVs3iyxCKnN8r/POSYwW/uL+1OXgKLiZ7istdfsJke4keZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; c=relaxed/simple; bh=/UkdKZ07rjAMo1NkFVRpRJv3Vu7W9nRDzv0QA43jVJI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WxxeCov0wlvpwvDgLMRTQj2Qtg8pLL2Zi7LbqIUGS1PzaReml2PWNSVQXqT5Y1hPPB/HDtfo3sDvzaRaXYRWJwHlbBN40rMMG1/TUsfZBaI0A9Tf+eEPME3TUddlMbV5cfp0pvDMT047IbIv2J7cNo5J/+iSKhZlvm5cMewRP8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Wsk9R21hpzpStw; Mon, 26 Aug 2024 16:19:23 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 1AC0F18006C; Mon, 26 Aug 2024 16:21:02 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:01 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 09/12] mtd: rawnand: mtk: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:44 +0800 Message-ID: <20240826082847.2591036-10-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/mtk_nand.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nan= d.c index 17477bb2d48f..d65e6371675b 100644 --- a/drivers/mtd/nand/raw/mtk_nand.c +++ b/drivers/mtd/nand/raw/mtk_nand.c @@ -1432,15 +1432,12 @@ static int mtk_nfc_nand_chip_init(struct device *de= v, struct mtk_nfc *nfc, static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc) { struct device_node *np =3D dev->of_node; - struct device_node *nand_np; int ret; =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D mtk_nfc_nand_chip_init(dev, nfc, nand_np); - if (ret) { - of_node_put(nand_np); + if (ret) return ret; - } } =20 return 0; --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 7BCE815575E for ; Mon, 26 Aug 2024 08:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; cv=none; b=dAQGrdOtBvFlmR87oxCTIn6oEXldKNhUgdtN7tNcNgLLmJmNBnE1JVCewHpjZk5C1nuEFlUFxdup/OatOFuV73tU/cHP+gQHARizwqMz4QCLoV0plcVCd0YtFmb1FfsWTwkGUGMGKHRLMBL9Z0kYIcAzwBDq8was13vIoutENr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; c=relaxed/simple; bh=kaPWioaY10ge/EeuBsJifxGnuaMakkiK/YMcIwPG2Dc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=arQ9N5a4kIFSsSGsDw/J9TLH19qvdr1CWXAi4l7WxKh+6lbSEWcHvi6f/s07KxSZ+vhqL5EELbv4RcYFDZfChGzLVxOEOZOcCWoCYsl/WTm3w7vFu0tcDa0E5XdnG0iKssVL6Ih1NQIyMQnizlMMe+FUgi3jQnb88EPRBanq5cs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Wsk7X71Wcz1HG5S; Mon, 26 Aug 2024 16:17:44 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 667531A0188; Mon, 26 Aug 2024 16:21:02 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:01 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 10/12] mtd: rawnand: renesas: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:45 +0800 Message-ID: <20240826082847.2591036-11-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/renesas-nand-controller.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/raw/renesas-nand-controller.c b/drivers/mtd/n= and/raw/renesas-nand-controller.c index c9a01feff8df..0e92d50c5249 100644 --- a/drivers/mtd/nand/raw/renesas-nand-controller.c +++ b/drivers/mtd/nand/raw/renesas-nand-controller.c @@ -1297,23 +1297,17 @@ static void rnandc_chips_cleanup(struct rnandc *rna= ndc) =20 static int rnandc_chips_init(struct rnandc *rnandc) { - struct device_node *np; int ret; =20 - for_each_child_of_node(rnandc->dev->of_node, np) { + for_each_child_of_node_scoped(rnandc->dev->of_node, np) { ret =3D rnandc_chip_init(rnandc, np); if (ret) { - of_node_put(np); - goto cleanup_chips; + rnandc_chips_cleanup(rnandc); + return ret; } } =20 return 0; - -cleanup_chips: - rnandc_chips_cleanup(rnandc); - - return ret; } =20 static int rnandc_probe(struct platform_device *pdev) --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 F16EB155CBA for ; Mon, 26 Aug 2024 08:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; cv=none; b=VHg2A0CaxbVduatdfZ5h/CWfJFb+FfnS3VJA92QbeNdEw3xAJdKvxHr0SiJyqhzKu+xNNtVp5RwesZ3zVe8fBGBrSIafTLT318Z++xapISokma46HDwuf9ALkrJOBYP1y478IxktRm+vUVAPWUYrdmM4UraQrIfIsU9yZvE+r68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660466; c=relaxed/simple; bh=0fEzRVJBNer7g/5p8A4HmoX7GUhsiSUN3gks6XZ4zaA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hH+idb57GvD6Dxu6cwbKUVLHD2AmC6wJPgUeCPG+OGgJqUFL/2pXJ9OLvDG3ZH2edtWoxZOCXGlSFiq2WMixLKcUxdbiaciEkx+xW6ML/6bzA8lXXdONboyAdPh07/JFL7bBqH2AoUR27hHmC0ZK79WI0/i/XZ+54IkUBtxG8e4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WskC947Kfz1S8qt; Mon, 26 Aug 2024 16:20:53 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id BD3D81A0188; Mon, 26 Aug 2024 16:21:02 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:02 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 11/12] mtd: rawnand: stm32_fmc2: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:46 +0800 Message-ID: <20240826082847.2591036-12-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/= stm32_fmc2_nand.c index 264556939a00..0f67e96cc240 100644 --- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c +++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c @@ -1851,7 +1851,6 @@ static int stm32_fmc2_nfc_parse_child(struct stm32_fm= c2_nfc *nfc, static int stm32_fmc2_nfc_parse_dt(struct stm32_fmc2_nfc *nfc) { struct device_node *dn =3D nfc->dev->of_node; - struct device_node *child; int nchips =3D of_get_child_count(dn); int ret =3D 0; =20 @@ -1865,12 +1864,10 @@ static int stm32_fmc2_nfc_parse_dt(struct stm32_fmc= 2_nfc *nfc) return -EINVAL; } =20 - for_each_child_of_node(dn, child) { + for_each_child_of_node_scoped(dn, child) { ret =3D stm32_fmc2_nfc_parse_child(nfc, child); - if (ret < 0) { - of_node_put(child); + if (ret < 0) return ret; - } } =20 return ret; --=20 2.34.1 From nobody Fri Dec 19 15:16:28 2025 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 6854716BE14 for ; Mon, 26 Aug 2024 08:21:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660467; cv=none; b=HS6PEbJo4+boAAmsq/5VuLIgKcOud8Et8BSbrzs4L9q7R4bWXBRxeHH312fUhdRD1wtz0mNoTUKB1HUVBFTtcNeLZOw1A3SaGwnH7TRNOz7kOd/UAWG0eIk+2URZdwETzcrc0ZSVR5dufwWAhmJePfWzWLpE5R1jfEcjkZP8TEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724660467; c=relaxed/simple; bh=vfXewUwzPB6qhkRNaNZS04fN7FhU1/X/KK9wiyizDmI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ONTrfXN/ddq82eCkXOmYig9PQGhdYTwKAJ/4jKRZKEhLFN8hpW+PIkqthuYMzVugYStIMBpBVew+TYjIs3bHJpGefvJgWeTK27wjNkw8B0atgX6qpU4PGJWOtTKkkmvrmajewh5NjKq/ojqOfqYpjLWQvaP3i3wDVbvTnHc+t2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WskBq0NKJzyR4p; Mon, 26 Aug 2024 16:20:35 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 1078E1800A5; Mon, 26 Aug 2024 16:21:03 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 16:21:02 +0800 From: Jinjie Ruan To: , , , CC: Subject: [PATCH -next 12/12] mtd: rawnand: sunxi: Use for_each_child_of_node_scoped() Date: Mon, 26 Aug 2024 16:28:47 +0800 Message-ID: <20240826082847.2591036-13-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826082847.2591036-1-ruanjinjie@huawei.com> References: <20240826082847.2591036-1-ruanjinjie@huawei.com> 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 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/mtd/nand/raw/sunxi_nand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi= _nand.c index 4ec17c8bce5a..c28634e20abf 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -2025,13 +2025,11 @@ static int sunxi_nand_chip_init(struct device *dev,= struct sunxi_nfc *nfc, static int sunxi_nand_chips_init(struct device *dev, struct sunxi_nfc *nfc) { struct device_node *np =3D dev->of_node; - struct device_node *nand_np; int ret; =20 - for_each_child_of_node(np, nand_np) { + for_each_child_of_node_scoped(np, nand_np) { ret =3D sunxi_nand_chip_init(dev, nfc, nand_np); if (ret) { - of_node_put(nand_np); sunxi_nand_chips_cleanup(nfc); return ret; } --=20 2.34.1