From patchwork Wed May 1 12:56:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 13650677 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 B439FC4345F for ; Wed, 1 May 2024 12:52:53 +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:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=B/0Un9v6vVwu0fNsjlVV8Xe/ZmEf/resWN05lKHAGOI=; b=qkF/lQoNQSjyO8IZ1eYv0EnC4F JNKENYA01DQn8Z0BtuixLQQFjEtuYizd4H/4t0z9tvxRXjqXNrszhwB9EVREEVSHam0xEuTQPqqaU Wk1tVGmre9yfqhWn1NrgAJQ9ij6VLeE7UeDrSK5232Ed3LEWnd5/3bUK0ouPavBksk03amICFwMHM 6AV2u25/z6qsqQciZdgtIa0E0JAa0CWXDR6rQrCDkDtv/Ape01aGRYwx21VtnRiaw0HapH2V0LuHi pCIc7wx2Hpicd4zR+WeO8ZuQvXuXqO+/iKf0c9JunJMJ28TO9ErZx+sCXreotfraJaKc3g3cy08vp LaJxfnvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29S4-00000009aYU-0zUo; Wed, 01 May 2024 12:52:48 +0000 Received: from mail-he1eur01on0601.outbound.protection.outlook.com ([2a01:111:f400:fe1e::601] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29S1-00000009aVN-2ZEM; Wed, 01 May 2024 12:52:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XifoDNFy+OIEK+L1N3yuEmV5XxdlcDY7VEDXhd6JFqp0mpxPhZgUdo/lpIIzxLUjnMymIYzrtiDr2hLLA3rzjrgq/8GkOsbEDmKLr78QTf0iKZ52N056amWTpcs+ZAs3YVgaLlq7ieIN5D3wZZlNqMp5V/GzUFJ6gs3uvQX8G/AD7+y2JQuYYGXTXWKPsn52JcUIaZIF+MqOJzB6jriDDfq+G7OIVLt9ibhonhCJYDKu4sQ+aIIpiHC0XcZUW5FE/PyRGH8+4f9lLMxavBuIGzfOS+Pm9QdcJaQltYRlmozL/D7bbK0GCqME9v9sOysSlKmpVcL9DrApXCKUPtaxjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Wh46VIFFtnR87VP8CR7uMzRt81dfHvC2gK19Gu2CtGM=; b=Z7XszxlL7Cd4EqBxsGRR3c7nh17exvXRKG5Xc86hzFyVwP/5aay1BDHBK+DdQXPmsrW4gmO2TBJg673S5e7cuyfZO0fcJAQhywHN8IEZbSyCCh3xqa2naV2TdgAgk9TrwG/r1J70m2/09XssXrwm119ZbG1BB0GseRt0G2yeqgnwpl44wgS5IuThMt37c7yJ21ayN9dIzcsVo3pKrgQUbEiuNAi5OfHSYL8gG2QNtmaZ9Mqn5a/ksZRu4kxiGCb+vZIdyDSnJdAblYBSaJQpQ+L1QHCOfz63pEvcSpuQXv2h66J3umxzYO2fI3JoTnPJ2uW8pVYIULuMsaipnQpyzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wh46VIFFtnR87VP8CR7uMzRt81dfHvC2gK19Gu2CtGM=; b=XcMBz3RD6J+BpOdQUcC+tI+ZS4U4ar6yAE7Ic9ceBZh00UY3Vze+v4QW0K0dkPqridb/N+uAh7bKF8b5WPN0leb/tl3uFohVjl6otL1ESHh0Fp4zJjevHJIRkCmhaGh94Z9Ay99uQcPquTMQ3AYo8wKrs8bs1ljsDXEQ7TopfBU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBAPR04MB7448.eurprd04.prod.outlook.com (2603:10a6:10:1a6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.38; Wed, 1 May 2024 12:52:41 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d%4]) with mapi id 15.20.7519.031; Wed, 1 May 2024 12:52:41 +0000 From: "Peng Fan (OSS)" Date: Wed, 01 May 2024 20:56:14 +0800 Subject: [PATCH 16/21] pinctrl: nomadik: Use scope based of_node_put() cleanups Message-Id: <20240501-pinctrl-cleanup-v1-16-797ceca46e5c@nxp.com> References: <20240501-pinctrl-cleanup-v1-0-797ceca46e5c@nxp.com> In-Reply-To: <20240501-pinctrl-cleanup-v1-0-797ceca46e5c@nxp.com> To: Linus Walleij , Thierry Reding , Jonathan Hunter , Dvorkin Dmitry , Wells Lu , Maxime Coquelin , Alexandre Torgue , Emil Renner Berthing , Jianlong Huang , Hal Feng , Orson Zhai , Baolin Wang , Chunyan Zhang , Viresh Kumar , Shiraz Hashim , soc@kernel.org, Krzysztof Kozlowski , Sylwester Nawrocki , Alim Akhtar , Geert Uytterhoeven , Patrice Chotard , Heiko Stuebner , Damien Le Moal , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Dong Aisheng , Fabio Estevam , Shawn Guo , Jacky Bai , Pengutronix Kernel Team , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Sascha Hauer , Andrew Jeffery , Joel Stanley , Dan Carpenter Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-samsung-soc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714568179; l=1905; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=x+RKtlqeCysZbUAk0csydxI+b9I02cK4F7LOISGb+DM=; b=Y3+vk3f43AcNvROw3kkX4CgId2lnsZyoUr4FCfrXbQW+2RkiW/K4kuVSb4mcgJzb01ENb6OLL Tw+jfm6cSIaCjvByic6cwwOvm+A9nbuy+hC5xdMXE2JwFxQPNCx6NMJ X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0064.apcprd02.prod.outlook.com (2603:1096:4:54::28) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBAPR04MB7448:EE_ X-MS-Office365-Filtering-Correlation-Id: 338cf59a-6dc3-466b-c9f9-08dc69dd9634 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|7416005|52116005|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?GbshhS8PiNjgPh4IXLtVxGbP+mZsUMj?= =?utf-8?q?FRrykmuDUUAMUPqzzozK1DMXS/MNFbzwTRTj+02w8KZcdMqW1bZRc8RMJiYyJmO53?= =?utf-8?q?WQSsHA+PrPosK66opifyFKcM1PpYl75ip3bEaLwtAZpQnIHqf2gOMoS+1Cw8dC2dt?= =?utf-8?q?i8I8jP5YkKjoAw/gS36Vt1jVzTMc9W5AwlF67fMjWWBHswR6IZzpwzYPugdsrYSn5?= =?utf-8?q?uq6hMUZm+NdpRzptkBsWmwXNfU9spzGpiF6zZ4aeBaiIUlskRF9Enr9UjcpHUFGPx?= =?utf-8?q?/MX2us/10Ce2I6DEXKGCro89fdCvB/f6FiON/2sqMUQ6ZBvCfyB7DVxqGwLzGPFjP?= =?utf-8?q?qptpGy3UXEj9Ysh94lowXD9krgtfdC83mqx+IyU3iHwtTUwgpsHeLathAHwsFq0+h?= =?utf-8?q?g8ksc8Af5STgPVCb2xMAxI8CgRndn1wIPYaemLgye1ZVEor32c4j1mLYbP5geisdI?= =?utf-8?q?B8xBV0ePtmRhANfqct5KUmPtvnZXAEwlpJjsYqhoHvNpFfDCPKfA5xv9RQLRoLoKB?= =?utf-8?q?YF7zdcoH+nEwJ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.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(7416005)(52116005)(366007)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?JiwfMhPPtEWrmDRh5AF8ydrtQ4Gh?= =?utf-8?q?hvaA9akwOai4kHrqhleme4GMK3Dd3Fx64q+KJWF0BDpiMVUPhWlhHA0DYTEpRQC9r?= =?utf-8?q?xP7NSiES7jDRzs/MOBb8fJlLUyISZc4M0ZQ3aMyCBufKsFc738s8SluYG4cq1CRq1?= =?utf-8?q?P4QT9+KkwejWov4W/FUCWJuRy1mA1upw+5DHUosXzwGbKk005qOUiPiMOYR5r3PsE?= =?utf-8?q?wt/642+be9CNoKlW+IM/snaW+as1ZUTB+mqoofPO9YNsI2fxxBaXbxxRHwdZ3TZXm?= =?utf-8?q?wRMXg2vyRFzF3mJzgNxeRBXJ+rRbpYhDGDWFCGWLAK5ZcCZC+CkLA0otI9zu2Ak3K?= =?utf-8?q?Hs6SI1Sli3odUjX74fHJDFgOu65mC1yVx5VnYK3CBpImwIRQlizE3seIPhO7bbwsL?= =?utf-8?q?TqOK7BcBTosZ7cY5yYzqiXEUWzxy4FykzWGznqH8IOkwUpDH1tc2SAeYtpSDRmwvx?= =?utf-8?q?OqEY6hsXgSRSdjd2wWAmmHwsdb8yZcFNp10HuUtp1Opg2gxMuFXjsAOIeqbZ6JUFx?= =?utf-8?q?3y12nT7q/srWTdsOHlw7DV/JUoMVAksbnwrmf73KDu/2NvRkhvh2eGvZsAxeCMvqH?= =?utf-8?q?6jd0Y9Kcb0+u6w02vORPLkoxlTrP2Y1eIkfqBHxyZPjj4YpSXjjaAA+FrY9h3hCmd?= =?utf-8?q?8xFX61NqaUKOzUJUAIE0uSaEsM81B1JmJIVgu0USkMQ4RVzL0vZ8qIJSrbOruDqoc?= =?utf-8?q?xucFfyDdBJx5IRd1PywYhG6D/MwLKNsIHWjydvhzHNqxyZHxtbsuFWcIC4hBuQOtg?= =?utf-8?q?cOIr9urOpzFMUuwz8gL65MuisgMfSH+fVg2rwtax4odPAAwBcYtZeP3K63LxoPJRY?= =?utf-8?q?vqKBYEUHN02VRsKVzqPE7Hn5jTcaKET+eF5GmbBJrOPHYD1vU4bHE0H7kY3WVLHtf?= =?utf-8?q?34JRNciko0k2rOkW3PkTDC+wYylzh1Dyr8/LKKservhsNw4D1w6Ld8LWceGbFygfC?= =?utf-8?q?17rS1a2NNPFjAMKUeRPtCT5x7emyQm1u8gjwqZYeq6CmWABceMV1hZ23A+EdF5LjA?= =?utf-8?q?8Aw3Z+encQK9e1mE/nWZqYa+pnngV1SddP9Ne9x44R0bZu4W1O7th9vs6olhsn2EH?= =?utf-8?q?H5AukxYjGanQvqWzPBYpifA5/ToogbpNJkKtxKBmwEREudy9UHpTsdiGEqL0Tlp+U?= =?utf-8?q?HhT2095e3GU2eDTdJin632ANrFVRt1Sp21x83BvUQY27McGeKQ9tcscvT4zyswySo?= =?utf-8?q?s4sAE15JGFzckDBzPUJiHdJ/MmcfSUJdz9IjM6bzZgnJrY7iW2AJe+KUUjLB/JTIl?= =?utf-8?q?d60rmBhLti4jxkNZiwNQbktrUQgGkkifPCla7ZPUsb3G8O8Jse4tQpEoizUyYtu87?= =?utf-8?q?owU0O/s5swqfYebgUUP0W8ORbBoNpKUzBrV8ap+OW9ZIlTuYBGlpt5EDznLq+Mkit?= =?utf-8?q?zpuhM+kdkb23gIStO0enc+bpW6tpLiBxjgqcA6PAOJ3F/nooTOyds6/TfoHitIQUR?= =?utf-8?q?3kWTtroVqGa0EfOr5jm0KjPzoXTNO7C8L0lepGQeqKXALoAMiT7jr4jXzoX4poFhY?= =?utf-8?q?TorRV6AI0+rv?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 338cf59a-6dc3-466b-c9f9-08dc69dd9634 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2024 12:52:40.9503 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7BwTvFoAifewf9K//sLx0gnboIdTV1IhnrFyKGTjhX+6geimmswC0t0O4NdJwAILhii90JVZlNfmHkLVmbObVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7448 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_055245_891228_BF394FF1 X-CRM114-Status: GOOD ( 11.40 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Peng Fan Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan --- drivers/pinctrl/nomadik/pinctrl-abx500.c | 4 +--- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 80e3ac333136..47f62c89955a 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -811,19 +811,17 @@ static int abx500_dt_node_to_map(struct pinctrl_dev *pctldev, struct pinctrl_map **map, unsigned *num_maps) { unsigned reserved_maps; - struct device_node *np; int ret; reserved_maps = 0; *map = NULL; *num_maps = 0; - for_each_child_of_node(np_config, np) { + for_each_child_of_node_scoped(np_config, np) { ret = abx500_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); if (ret < 0) { pinctrl_utils_free_map(pctldev, *map, *num_maps); - of_node_put(np); return ret; } } diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index cb0f0d5a5e45..fa78d5ecc685 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -804,19 +804,17 @@ static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, unsigned int *num_maps) { unsigned int reserved_maps; - struct device_node *np; int ret; reserved_maps = 0; *map = NULL; *num_maps = 0; - for_each_child_of_node(np_config, np) { + for_each_child_of_node_scoped(np_config, np) { ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); if (ret < 0) { pinctrl_utils_free_map(pctldev, *map, *num_maps); - of_node_put(np); return ret; } }