From patchwork Wed May 1 12:56:01 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: 13650592 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 E4626C4345F for ; Wed, 1 May 2024 12:49:22 +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=hy5T5npkW+d0i/qIZSopj1WC4sx9WIrFld9prbqUcIE=; b=pY9QAs3l7A+5uGlLhrG18HBu2Z QSHiV5bMceWP4sirPf/ZFBH52c7tpTH0Z9o8Eobp6cYN5ooIOWPPuBOPdgjV9QD3qcrYY93chvdsW BZvt/yWNwmYXf0NXEgygHaU4CIjiSiL9wRuNZDqpU+Hmdg+pNFBZTolMEZhaQubWTB5AQAfWM62e5 l6NOyGYVjTJblPIusZiyGbB8mA6+HLlkF9BYeHmMNfucFZ8BXtp4+dBv2ntsjXve4kz9NgZUrw2+o t7gKT+AnwtVVbosremRCcziCXiM71b5tTQVk8AMH81Ed47xmohN5KEPzM6L8vBJp8N0MXUsoxOA9R zM4xlIXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29Of-00000009YSa-3IFc; Wed, 01 May 2024 12:49:17 +0000 Received: from mail-db3eur04on0608.outbound.protection.outlook.com ([2a01:111:f400:fe0c::608] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29Oc-00000009YPD-2Baa; Wed, 01 May 2024 12:49:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oeu47Q+dPv1DPnRVGtc6IiNSPWuUWczHuMJIvx/20XaKHr4tGZ7eStixVLJKlt6k9gXBP+1/PR67tQAMiDlnrHAlpuNWxKdDAF6bDS1NzZ8GHl1UN6f5afpgN3LX7jWR7JOMnH90w8dA5VG5BzgZ7d9lSUkmbJ04GoIHryivbP1QDu3EGjRLivniGmriEkbOKZoWfCn3tAUjffx1OT3WstUpQs8VmUWCQSxdnmuFrLNmrmmrmXe6gsHNPwsG68kwa/8wPslY1o8lpxHDaO+gCofqCdwUNhwr1ov6l8sn1NHkf9pkclPfa2sPQ93DOCz8a9mhRyey486T8N+tbok7sA== 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=ZWbaOnhitppwCU5btaK/2yH59NAaiI69tzBZ/+l5Sls=; b=GRlchT30TLUK57xGbReuKjfzmTSUr9s7OMLTNM7oX8VHditGMqb655tXxxqqGuLO5PZF+kd4uUDc7COHYN/Fk8oLFjkbpZiinCR/rOr2bv8lH6pty5oKDQuQ9v8pIvv5Cn4JBHrvi97mZAf/9d/3xSP7Ts+oJ+6xIuaDRxld72sDAHLRVtTauuMJtY/X57HpiDowhh2Y6D30He09nz2/ShwRJ9/KMhTPKnX1TOBeC03VrO9l/EtbFnb5P+wWOCLa2ClWGa3CcUKgsSnXuz41Cs9e0ERzmkq/AKfmRe/AsLaD65Js+0xvlgf/rzIyvWbx9a1mjSzZtKNg40Iu9vuyAA== 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=ZWbaOnhitppwCU5btaK/2yH59NAaiI69tzBZ/+l5Sls=; b=EmmRaZXLTcmyZ8/Gzn7BfXWIGm50cFWw1ABS/y4xR5FZ0rFwDj5ScpJilmo29x49sCMfAzTWuXKku97P0fc2ra9ASs/2muNOJzKA7Fev155/6SxjfM8g9LIw9T/5jyiKaZSzT28wJ0+x/A2r7loWZu3KbtlansoFo3F/zca20J8= 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 DB9PR04MB9284.eurprd04.prod.outlook.com (2603:10a6:10:36c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36; Wed, 1 May 2024 12:49:11 +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:49:11 +0000 From: "Peng Fan (OSS)" Date: Wed, 01 May 2024 20:56:01 +0800 Subject: [PATCH 03/21] pinctrl: sunplus: Use scope based of_node_put() cleanups Message-Id: <20240501-pinctrl-cleanup-v1-3-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=1303; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=+m9hOUks1zLp1UolZzmwZ7jTtIojf5UqsPjaqQIsEwQ=; b=IZjMe94P6fYw86SmgQeVTPliGzwM5/iZVmO4VECeHSp9Ch0ktEbWrPRvuWTFTkBwPt2Tg4ElP txogWLr0hpKCU4Qnc8bC8XisL27TbpzKeibh6Ju1lkhyT89QOJTe+0p 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_|DB9PR04MB9284:EE_ X-MS-Office365-Filtering-Correlation-Id: 065f0460-04e2-428c-56a7-08dc69dd1913 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|52116005|7416005|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: =?utf-8?q?uh1koQId+oR83QY+20yvjjCJPccsvLB?= =?utf-8?q?XslFDeOS2/VNbrO6EudoWxY2QCMfxJ2PpxkUXgXpD7Mt9ssKkZp79JHmhmk5u6Z8F?= =?utf-8?q?/PlrgiPe/g/mECAWEISqOs7t1mP7h+g54NL3aDhCPTmvprjWbf5BtVnmztpQqbs1j?= =?utf-8?q?LooAhhAEwsBg3zalFtPZG3hSlpiWSbzrCAIOe+SILL1znhuEG3r51eJfWcU7VPTMK?= =?utf-8?q?fqif5oNkLq37eb2i4Dc8AE39DUjw+orEqj7FuIPEpsDfeHGfRR1rwr9Sn6gLvbo1h?= =?utf-8?q?aidl79/Hc3aCY6qNt+wNoGn/KJpXHWKd+jNCNVrhjKqzS1wNEn8xZW21GAKJ52kYO?= =?utf-8?q?XVdze3fnj8L/8UFk6E4GbaJiGiYLP/IR5k55yzWXyoneO3szCDSYKylHt1BwGqsmL?= =?utf-8?q?o9EPTo1DCkuk+4pxKxNHPkjLvXFtweS18vcwEqdg6eBov/msz0/or9Xh7w3MB02OE?= =?utf-8?q?6vx3DjmNhdphz8bnXTWraq4HvfYbz3GcAi4G6kPJo2hpkIzU4gVASxgg/iQhBgoBw?= =?utf-8?q?M52OGOFQv48Bp670rfW5KV5oCcF8t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;SFS:(13230031)(1800799015)(376005)(52116005)(7416005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Fw23i56IibsNYGpMknTSwdYwALQb?= =?utf-8?q?bjm6CHgzG46tpVSNB2spp0/doB4FPwZHl1bZreRp2aMrhWbaEH2mHJNJPm1oAiKFX?= =?utf-8?q?GimzZWVNblHf5Z99GxhoT1bSPMwttIeZw8lRTGK4bIKy6610psxens7scUxlSsY4Z?= =?utf-8?q?rhcWO6cQaGmvhlBtBSUnUuHrZMnk3fGZ3xssi62IJQ5ufneNOiRhF3yXnAxFn3DWl?= =?utf-8?q?/+sBeR7y9FONPGr4nFclg7+b0IlvdiRZXIzKn77qs2T/j3etlcQ4qoTA7NLNvkv54?= =?utf-8?q?/VO2xj1jaLbuJDQtTMfFBbnXxn2UJDWClf82UyiAZKYS9UhlQ+V7kQDPTK6xb75R/?= =?utf-8?q?6rXgieY2aKHZ7XwBi2AGIYgeNmq1OcIBBoDZ53cuQrTE1YiV+ZDsMjKxJdVNDl72l?= =?utf-8?q?yGjkRGy6utLK2eK92exhjfgWtMCUlThEUd6l1cLznMY894fH38TOOY5TAN675wNYG?= =?utf-8?q?hJXidiHwHcck/TdLC01Z/PEVU7VHfo+Hnu2TtkRNPoGin95yUPUQ80TM39BVMc7Ls?= =?utf-8?q?yicJwyQGUgSBNWS11CpdwPIWdjF3PMftl5b2RyR19y+h/5vKngMk+PSBc5YJFR4A/?= =?utf-8?q?3N08gsaQSFEsbkbptKJi4NcD/F5tdlVtsLYun5RqF5GtkBpWfDoa8rmfgt1U9NMcC?= =?utf-8?q?aekmu44+1e5s2F+XYBIZ3eA0rftofRoZmZrr5Hufje2O09OwjZJh1HRiMYrpu5oFf?= =?utf-8?q?/6J9l3foPwM6XwLo7mYcT4eBWKw392/F0s81DHHfu+90G4BRvRxVFIutMS6tRtRkB?= =?utf-8?q?zc5Qh1LN4I24r0OTY3uVJxg2Q3zXty1UszSMLx0S3obUc8a5dZKkBCsNIYXmb6GlB?= =?utf-8?q?2dwBJj4lEP2wxD8Qh9frnlyBoKg62GGmdC5sEHPn1wzHMV4JhRjuhHa2/3xTVqY/7?= =?utf-8?q?CG68WLBG0HS1IjiFHzn//SuGXG662iGAqJkpbQ33VHyv49eB9Xc8mpsOjR6M1rYyy?= =?utf-8?q?Xg5vAOOsd85Th4Igtpw60rJkJ55h9K3knUyR3d+Z3tKXdnTO0xgDuCpyVCi2TkQ95?= =?utf-8?q?46s6cch8cG2/KeJC/lWDTIJkamed9vMlpnNzdw8sEL6eZwbls7W06FZVYltTMYHyI?= =?utf-8?q?sUpmeatcpUgiGXRMWvSjvJyWcPnWYYIbbCmRlCcWfzRTVre/LxV41lRvKZ1+TJKik?= =?utf-8?q?a9H1siyIaOTPCr6sZotmz/2tZrSC5rwG1un5T6/EA2HUZoj0IJZdWAtHFdWfuKZUf?= =?utf-8?q?upxGkgai+5cdAXuRAxHiXyNx2gOkEg21xvMfirzgHkUvYRZGetDT8tWAbQnRVqzTX?= =?utf-8?q?Y7Bw1XXSXXTgFXshKTzV1f8YnaCszDV5BD029DstZpmK082YJnuKLJMs+CHwoSWbH?= =?utf-8?q?pVxC5L6OJOuhM2cKR0wSRXHMfD99bgGX5Pk9gASEIuBa+a49uKpQbeRB4UvW90EW9?= =?utf-8?q?m1xP+pqgqdDLLlTjEOYTLAREsrtIVvEBXfjm50Q9nHI3B9qehCiXzZV+9XqD4YXUp?= =?utf-8?q?YO99iQ4lrrsLroL2padmuX4Sz4hR/7fOlzFZEks3QFelQB/KV4o9PpH8nE3WoGiTx?= =?utf-8?q?UR1vvJ9wtWDC?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 065f0460-04e2-428c-56a7-08dc69dd1913 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:49:11.0055 (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: kvq5FEOPiyJ+1kQ64iVQwxsQD3eMnMe+tmTitUmgyqQLUOxYlxzgOM82g+xPwvaQXsBROZvmNsKkMC2YFHNfdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9284 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_054914_651581_064E6490 X-CRM114-Status: GOOD ( 10.91 ) 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/sunplus/sppctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c index ae156f779a16..604256ec9079 100644 --- a/drivers/pinctrl/sunplus/sppctl.c +++ b/drivers/pinctrl/sunplus/sppctl.c @@ -823,7 +823,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node int nmG = of_property_count_strings(np_config, "groups"); const struct sppctl_func *f = NULL; u8 pin_num, pin_type, pin_func; - struct device_node *parent; + struct device_node *parent __free(device_node) = NULL; unsigned long *configs; struct property *prop; const char *s_f, *s_g; @@ -964,7 +964,6 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node } } - of_node_put(parent); dev_dbg(pctldev->dev, "%d pins mapped\n", *num_maps); return 0; @@ -973,7 +972,6 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node if ((*map)[i].type == PIN_MAP_TYPE_CONFIGS_PIN) kfree((*map)[i].data.configs.configs); kfree(*map); - of_node_put(parent); return -ENOMEM; }