From patchwork Sat May 4 13:19:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13653959 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 smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C007C4345F for ; Sat, 4 May 2024 13:12:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) id 47B96C4AF1B; Sat, 4 May 2024 13:12:25 +0000 (UTC) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2087.outbound.protection.outlook.com [40.107.249.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 1ABAAC4AF14; Sat, 4 May 2024 13:12:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 1ABAAC4AF14 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FXUDUbcDRVGIanueProxcTpJH0z2Aet1R0xqHltasXBJKywe1Gt/0WpMBQlLdGAhe5rXLowiRRY8pLc6+U5XWjbXyw4Q01SvtkWqBLzJtWk99Kbc841UFvIpZjqz0jYXtmgAPcLBjdt2Rekc1RXfnY6XUPuqXZu63XozTvfMH5ccS+1T/teMp+YGYBo0U8d9MS12xbBxRqtP/CBtHEIe3LoozsQqN201D2ywg1iC2i+95eZFIujwRzjxOlzfzo+6Ot/mjKVZ2m2i+xGFiVb9wRF6E46CwXugoF11Qsdl5jhstgyLgRoPCoX2OK/Uh3dtyxRK1S1cyOMkLQr5dSNCPA== 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=jR9dIeiHtuSRGz7ubbTGx1Y1d/RRRbeURdFmCd/Ctyc=; b=Ef4uXNCE0QiSoozdrN9vFmt2DCIufVrSGLI6/eSnmFbM6d9axJzCjmhXNZ7cBc4d+zRXmb+/fdWDx12hw/BhPGkpLmDo1fgdOafhnh6leAwi6PzN4QpoIIzunh101LRcvddnIGX05IQ2Rtk8TRaGuoJxrfWHVUU/8F4SV5RmxWfC7BM5nUvCz0OphjBSeNOMObmLQZ3adyDhPQH9+GgekPx0HM5gur7lPW1pdcapk293INvcJxUl7sRYjlR1Mfk3kyznV/rg3FE572FJBYsJw+U0igQ28J1+1FsfT5lrzO0JlpUOC1fqJVVg/xVZh4hcvyt2/HOXuncNt7fcxbIqtw== 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=jR9dIeiHtuSRGz7ubbTGx1Y1d/RRRbeURdFmCd/Ctyc=; b=mVbjghYDDiCssjCRhW0dUaabYtTf9luaTxJv+wmY7X4WVRdrnCTVVU5ajvZhFyHGJGiOODnybsedpAfpWnh2WQvjnk7NLWnxmfk9vGDy8YMEWWgd09ihvvGS0GZr/z3YwerYgSJ1HZFaiuT4/ja5FaH+fz30RiAzE9W96wq3IGk= 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 PAXPR04MB8174.eurprd04.prod.outlook.com (2603:10a6:102:1c4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39; Sat, 4 May 2024 13:12:19 +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.7544.036; Sat, 4 May 2024 13:12:19 +0000 From: "Peng Fan (OSS)" Subject: [PATCH v2 00/20] pinctrl: Use scope based of_node_put() cleanups Date: Sat, 04 May 2024 21:19:58 +0800 Message-Id: <20240504-pinctrl-cleanup-v2-0-26c5f2dc1181@nxp.com> X-B4-Tracking: v=1; b=H4sIAP81NmYC/2WNQQ6CMBBFr0JmbU1bSxFX3sOwIMMok2DbtEgwp He34tLle8l/f4NEkSnBpdog0sKJvSugDxXg2LsHCR4Kg5baSKNbEdjhHCeBE/XuFQSZwViFJ23 NGcoqRLrzuhdvXeGR0+zjez9Y1Nf+WrVUf61FCSmatkHC3liq8erWcET/hC7n/AFe3iR8rAAAA A== List-Id: 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 , Tony Lindgren , Stephen Warren 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 , Emil Renner Berthing X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714828815; l=4658; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=Psxl1oJ+xJ34kYUX8I+QBV4aSroRJk4mWf2+If3BgkQ=; b=cjF+2rF7bQJj6MhGLe4rUUqhOggP0pnLi0klFDpMx8UZ0YJRw0vQ6D+zPeUCVYVlNO4REBwFX BBDaJVRXvQqDfPs8bJGItpx3NL+32ktRC7IYCxCnVBxC7GqD2V3NB12 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR06CA0230.apcprd06.prod.outlook.com (2603:1096:4:ac::14) 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_|PAXPR04MB8174:EE_ X-MS-Office365-Filtering-Correlation-Id: 251d355e-e9bb-4ef6-8900-08dc6c3bd3a0 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|376005|7416005|52116005|1800799015|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?M7sIAV8yQst3dHbBfbblW8C6G8WiK61?= =?utf-8?q?0khAPYiD8GxWQLcp+4HxRWP7e9X+FdshqznUE3pDIKiUGovcousch5tJtokNxpAfn?= =?utf-8?q?GkfxHq62/ptIcCinT3AsabwALSZbJ/JeslsGaa00I6EZh7NCOGxqi0fhDoBQRNX1n?= =?utf-8?q?9KX37jZAfM38fZ8fz97DoxYZHJukhf/lKu0i6r0C/junKxeA3n7KOD5XUy9G0YUk8?= =?utf-8?q?AmcPbn4S2W03xQogbDyryearG2umGJTCtWDw3n6t9i1jyaB/nW/Z+97aV/xBhGofd?= =?utf-8?q?tNpOfJ6CFKh/eeEWmwbWBig3S6ip1Kh7TOazBxJLB9loLTMBoDijCe/jex/6SJhss?= =?utf-8?q?VeYB1CXGahUhbNuCQLPadfRexTCprgSR4FCtey06f1PYjnc14UyiMTlOuOO30yPes?= =?utf-8?q?N6fl29SUKWLru/HvJiTWF/3dbFEwyh69GGfEbHUdtS1XL9V7lQFOYE+jTD07tkX7W?= =?utf-8?q?PIlvJdIpOsRrWtK0tKOu7ajbgt+xkwCYNDKXISyEdKhoZKBcTMc2vS0p4ktwL9CcP?= =?utf-8?q?LNP8qOcuWWNmZhWxz5lIA74TfSrm8BRZrPkRhVRvbzjW8IidwKIa5qTlRj6UulliO?= =?utf-8?q?Fx+pCLMumiMdgkM91ZhGYPk+3hOEeskCAz03oecp3gwRe6SQ05AWBBYBUsDFVdAen?= =?utf-8?q?HVl/8Bh1x3+KuZElPkLiEqtszXb69TWgXIJL3Eab65T1YxeZ3Vg7L+aCzNw9rs0oa?= =?utf-8?q?M2CzPkeWc8knIns1oY1rjs7Jlk6OlOhfFUyi0+kmYK0o9R2xavz04z/i201cgC/L8?= =?utf-8?q?79UP/+oR9ckCMkGkDe9P6mNtaJA1jZsI4uwMnbpxw93ftOz3CWk2x6v1gnKbEJhwS?= =?utf-8?q?e4eTdMg3pT7jEK+xaj9VGERL8gmriqHw0OfSQMk7k2z1u0T21LTQQ+AQ41dvxkaRc?= =?utf-8?q?U0Aa7+jdxdRp9ikbL4qk95TP28HbnW+/76oFMnzQVgsTudu4leIM3LMDtayq2zHzd?= =?utf-8?q?pVN8I4DC96OUAlm+qWkl69+o2K4981Saqm12xiJGlp677bn9PDrsgy0I0bpZMIYjZ?= =?utf-8?q?RK+3U51PCH2My4JRe5z/K6rEhp8A+vNg+IkF9FhHvRQ7dU/xyRqgTctczEa9Nh8e2?= =?utf-8?q?qGIJJqTHvxsTF6MjKLoMc/Iz4mxLBagz7u9QAxfyQSZkVgSWwhkpPqFwcPQaKaryh?= =?utf-8?q?qXCC25/m8c/V99z9lQjzK5Tj2b6QeTIafKJj47Y6Upvoxoxjs7GCGZfMKYb7mcH31?= =?utf-8?q?w3h2XMgzl9sD3CV+HKUB+98By4+Tgc/jf5YScEgqjYilr7TE0hFKLTrJE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(52116005)(1800799015)(366007)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PwC7zuconaE+fDlggj8VUdphXMIj?= =?utf-8?q?3mSmEsxpPIgg+vDhNNq5HWLLBlp3ZPvLAaEiIpaY4frYgZVcCnj+yqIdoQgUnLpaT?= =?utf-8?q?tagCRPQ5H4TNdh+Xo9WwErbzpW2P6eTS3eX9ERLcGskk+W+lb8vq8HxsdJdjO6rAL?= =?utf-8?q?00ep2+5k5BYedvx+KPq5mQ7vP7rLl5EeTDV33o2Rao/SHAflVlh3Fxd1bbWIC6BHf?= =?utf-8?q?u6QjEOK/hNKCutIXLd4NF3Qg3A5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OBtI6yEt8An4LgrdHdwgrL9+Kh8ipSAOq0c3TT?= =?utf-8?q?WFKOigZdhnS3Wu+t6tNQXenPjWTS6g44WYacIrZoW+wPBbdWcaVtO31yaShVbEbX6?= =?utf-8?q?M3KtwM1JMfprGuQLPMQE7RTucQuFIHRS3uJyVugYxBK3k9OKWzOr9vQkF510IZqtO?= =?utf-8?q?3Pv8KVGthvbyeFjCPZ2fWz90W2leTuxXQPPLKCuUFI+gp5PCoacFFG7qkMv9B+DdM?= =?utf-8?q?JNRLvNNv989Lyh1203HZF1bj595c4RQN9T3VvPc0DttaY7WKsYKn0sYboaelF5O1M?= =?utf-8?q?NSkKa3E+1JRUHOoURTZ3shXdiAQaVM8xjaLJdspmzY22gzzaWutmCkxjhmjx0KSul?= =?utf-8?q?CVXMNP7Hqhn+wED59xwiKscqAUv2/BL9dJbD+w/taAH5x9Uos2on7P5QEXVo8iRqJ?= =?utf-8?q?uhlM3OxqsbIk?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 251d355e-e9bb-4ef6-8900-08dc6c3bd3a0 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2024 13:12:19.1441 (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: 2FQMhTUfAZfQJS70hq3OAoIeeGhMmkBwaNi1toUM7P1Km+cABdoa91gEp06PMj/RP7svmWkPK1/CTg6KKaXHfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8174 Use scope based of_node_put() to simplify code. It reduces the chance of forgetting of_node_put(), and also simplifies error handling path. I not able to test the changes on all the hardwares, so driver owners, please help review when you have time. This patchset was inspired from Dan's comments on pinctrl-scmi-imx.c, thanks. Signed-off-by: Peng Fan --- Changes in v2: - Drop aspeed changes per Andrew Jeffery - Drop changes to code pattern that of_node_get(or other refcount increasing) followed by of_node_put. That said, but I still have a change for samsung pinctrl that drops several of_node_put places. If this is not welcomed, patch 20/20 could be dropped. - Add Fix tag for patch 1 - Add A-b for patch 4 - Drop unneeded {} in patch 8 Per Dan Carpenter - Add a new patch 18. - Moved patch [19,20]/20, in case people are not happy with the changes, the two patch could be dropped when apply if no v3 patchset. - Link to v1: https://lore.kernel.org/r/20240501-pinctrl-cleanup-v1-0-797ceca46e5c@nxp.com --- Peng Fan (20): pinctrl: ti: iodelay: Use scope based of_node_put() cleanups pinctrl: tegra: Use scope based of_node_put() cleanups pinctrl: stm32: Use scope based of_node_put() cleanups pinctrl: starfive: Use scope based of_node_put() cleanups pinctrl: sprd: Use scope based of_node_put() cleanups pinctrl: spear: Use scope based of_node_put() cleanups pinctrl: renesas: Use scope based of_node_put() cleanups pinctrl: st: Use scope based of_node_put() cleanups pinctrl: rockchip: Use scope based of_node_put() cleanups pinctrl: equilibrium: Use scope based of_node_put() cleanups pinctrl: at91: Use scope based of_node_put() cleanups pinctrl: s32cc: Use scope based of_node_put() cleanups pinctrl: nomadik: Use scope based of_node_put() cleanups pinctrl: mediatek: Use scope based of_node_put() cleanups pinctrl: freescale: Use scope based of_node_put() cleanups pinctrl: bcm: bcm63xx: Use scope based of_node_put() cleanups pinctrl: pinconf-generic: Use scope based of_node_put() cleanups pinctrl: freescale: mxs: Fix refcount of child pinctrl: k210: Use scope based of_node_put() cleanups pinctrl: samsung: Use scope based of_node_put() cleanups drivers/pinctrl/bcm/pinctrl-bcm63xx.c | 4 +-- drivers/pinctrl/freescale/pinctrl-imx.c | 25 ++++----------- drivers/pinctrl/freescale/pinctrl-imx1-core.c | 16 +++------- drivers/pinctrl/freescale/pinctrl-mxs.c | 18 ++++------- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +-- drivers/pinctrl/mediatek/pinctrl-paris.c | 4 +-- drivers/pinctrl/nomadik/pinctrl-abx500.c | 4 +-- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +-- drivers/pinctrl/nxp/pinctrl-s32cc.c | 31 ++++++------------ drivers/pinctrl/pinconf-generic.c | 7 ++-- drivers/pinctrl/pinctrl-at91-pio4.c | 7 ++-- drivers/pinctrl/pinctrl-at91.c | 14 +++----- drivers/pinctrl/pinctrl-equilibrium.c | 21 +++--------- drivers/pinctrl/pinctrl-k210.c | 7 ++-- drivers/pinctrl/pinctrl-rockchip.c | 11 ++----- drivers/pinctrl/pinctrl-st.c | 37 +++++++--------------- drivers/pinctrl/renesas/pinctrl-rza1.c | 14 +++----- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 7 ++-- drivers/pinctrl/renesas/pinctrl-rzn1.c | 23 ++++---------- drivers/pinctrl/renesas/pinctrl-rzv2m.c | 7 ++-- drivers/pinctrl/renesas/pinctrl.c | 7 ++-- drivers/pinctrl/samsung/pinctrl-exynos.c | 16 +++------- drivers/pinctrl/samsung/pinctrl-samsung.c | 19 +++-------- drivers/pinctrl/spear/pinctrl-spear.c | 13 +++----- drivers/pinctrl/sprd/pinctrl-sprd.c | 14 +++----- drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 27 +++++++--------- drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 18 +++++------ drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +-- drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 7 ++-- drivers/pinctrl/tegra/pinctrl-tegra.c | 4 +-- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 37 ++++++++-------------- 31 files changed, 133 insertions(+), 298 deletions(-) --- base-commit: bb7a2467e6beef44a80a17d45ebf2931e7631083 change-id: 20240429-pinctrl-cleanup-e4d461c32648 Best regards,