Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp408712lqh; Sat, 4 May 2024 06:16:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXeZPyJQNuG0T3jQM40sNVCqlpjJ3Aaq2iB+q8GNDo1x3V6k+eP3gCgIkvDcOVZvtihu2E7GN6f2n6pyqKV0dQJN8XGFzAzanTpEccrtA== X-Google-Smtp-Source: AGHT+IGq3LVP4pUpCUs9f21YjoBwhPq1M/achAJTbYG9Cit4u8ihsWGbdkFloFVwMCMky1S3IOhX X-Received: by 2002:a05:6512:ea8:b0:51f:9549:9c0d with SMTP id bi40-20020a0565120ea800b0051f95499c0dmr4950461lfb.48.1714828589040; Sat, 04 May 2024 06:16:29 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a16-20020a170906191000b00a59ae634e44si391793eje.462.2024.05.04.06.16.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 06:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ikUa133S; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-168682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8AC871F220EC for ; Sat, 4 May 2024 13:16:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 984E239FDA; Sat, 4 May 2024 13:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="ikUa133S" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2076.outbound.protection.outlook.com [40.107.22.76]) (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 5FE383D0D1; Sat, 4 May 2024 13:15:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.76 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828545; cv=fail; b=cmVs+NTSjWNjcHNAVOZjEJ7116eiBdKJLGfk6ShxrV+uH9JpsZJhl6qBjj6Pxch70aEYB9EgsGgG5kSM2X295vXX2fz8ZhX2N/tOUZdKYcRwYVgLmJ3tY9OItuPj6ksret/TT/U6l1vZB3kAUn7xSfSF1pDZ2OwP80guYnDZxuU= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828545; c=relaxed/simple; bh=XjYcrC4knEYcZi59FiMv3CxGYKeUFr0HCFF+UrzXVqE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=bNPdy1MrdJUKSoXP+ufOKTFu23TBJotMNVff8jCHciC4Tf4jYg+fKFQrDgJljd/20o+RKnITkEVINLrOEJJVi6I78IW3X0YmFY8aAobSEttKt2da2AQxZ1ALSJ/rJImkVT8Wh2Gmj9CgmE0dDlT09LgOi6GLQTLQ4Jv1v3KsWRY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=ikUa133S; arc=fail smtp.client-ip=40.107.22.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W13wp9FiM++nWc+Yz28yg2bbPZLLdw+WTg1bDgGDy97n7my34QTBMGJm9rCBvzp1jMM40UEGyYOCjXD0zS8w/4qkYpLKQvl7qMriD27ylLz18r1NRpGpx71+GEwMlRijcmKKUhs+CFXmH3G9kKcmBss3HTxz6j5/wfn2/ZkDbfipOOFZwJudnMiD2ird4Hc/j/vk2HMY4xe4rTH60RivfIHTmI/7r/gxMu5AU+cvfzkbp3oXgi+gdfEF2NaAknoNou+/0PzqNZ5+f40vNXUDVNCCLF71gCdSTz7Sj63iiXWC0PUSOU1MYg18Pk0DfHCpTkaY8eI6SEW49xo2CPrxGQ== 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=lfJwrgHZf+RNEj6PZEelZwXcext4Fk8ZGEAWxpPRGZk=; b=EhXMCkb8gOkREMgpBl9dMK0MTGtMhyMCwsI/DCmdxXmz2BiDju4e0MARf+kdgnef3ekgtf/sA9wJjhLkLd6Woccc6Qi0oJ9qXs7HxQ4XHHn9TeSdhapuG31Hto5GwfCrDrrSFI74qAb7guux+hptHu8hvQZKzhaSYIDPhsgyorjn8xKgNNXFlwfRhwKyWTt7SG6vfhYriDHOeo0SOkJBpHhlAi6OWt4yqsUYKvHFcL4PAVylfJghDn6Pv8pNNg/UwTdNciF4jQVyFOU6oSCDIwWY4aCHM1nfV3820Dw/nCDJc4Pwz1nHR6zgMJtCOq8jckdo093BlwodHwDiJ8gSQg== 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=lfJwrgHZf+RNEj6PZEelZwXcext4Fk8ZGEAWxpPRGZk=; b=ikUa133ScwGjkZxB3mOk8JOHeMMaVQC05IL6z7ifMBDxhZikG5oDN5sD5QpBRr4tLPYGOACUrjCuJdwC44Z297sorvsDzH3xZIa//z39u4jVbrh6HxrLaD6DnCKoTP5EFf6x/zLkmrhHCBDTN7wVZUv4UsoaReDqBrH4StYeQPY= 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 AM9PR04MB8633.eurprd04.prod.outlook.com (2603:10a6:20b:43c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Sat, 4 May 2024 13:15:40 +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:15:40 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 21:20:10 +0800 Subject: [PATCH v2 12/20] pinctrl: s32cc: Use scope based of_node_put() cleanups Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240504-pinctrl-cleanup-v2-12-26c5f2dc1181@nxp.com> References: <20240504-pinctrl-cleanup-v2-0-26c5f2dc1181@nxp.com> In-Reply-To: <20240504-pinctrl-cleanup-v2-0-26c5f2dc1181@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 , 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 X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714828815; l=2925; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=DE1TsODFhZuLZm6pDc3wReEJgqgWx9DxsgygoDyK3OE=; b=4lPD+sR8+ZJDBmnUSGc4BiJR63BC+fsZ9sA6ZLC22ieCU5l/dWZtPjTnnXlLTXwDaVFM8DgGy HeQBDCN8beEC267VymO0c1EOJ0IkKry6T9AQEMkG8hUVyAvlluXu2Hk 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM9PR04MB8633:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b200d19-f7e4-46c0-a449-08dc6c3c4bba 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|52116005|7416005|376005|1800799015|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: =?utf-8?B?eEhMUEhleVQ5dHNIaFMvZXZEaThmWkNEd3crdGo0dXRvMUhUVGhvbEFZUDcy?= =?utf-8?B?N3JxMkRkeExOZ2tjcUZpLzU5Ymxtd3hJejYvQk92WFdQVjJ5Y3BEQ1FtMXhT?= =?utf-8?B?SytJcThEWCtEWWNDRGp2TEpBTXNnUVVNV0tjemNIUnpYY2RlajFqV0w3aThw?= =?utf-8?B?UXB3M0pmRnRVYWZvaE9YZnQ3UkhwOGRhV3FqcGJ5WnFVRmVQVWtPVHRVb0xO?= =?utf-8?B?TngxaVhpNDRLeDVFYTBaNCtmU1NnSmwydlk3b1RneitidUR5MGh4ZWl3MjBt?= =?utf-8?B?SnliWEdvdVVuYkgwOWc1ak1kRGFKVHZDdW1iSHU3OTF0cy82TFMzQ1VZV3c4?= =?utf-8?B?am03cUltWGczMnVkb3d0YUxRSU5XNXMyY3JCdVlGYm00Z05FQTJncytoTEtE?= =?utf-8?B?UzFMQnZnMjlZUWdMWnJ5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b2lRSGRzT3ZJQklqV3BKQlh5YTl4YlpzZ0ZvUkt3TGNrOWp0VldQUm5o?= =?utf-8?B?a09jY2ZqcVBtTWdmd0hWS3dmY3puSSswaWRKQ3lxSmZCWmxsOEsxSjRJeXpT?= =?utf-8?B?OEFiNWRQVzlScDkxOGtaMjBLZGVqd0ovZDJWa0w0V3pKZ3pKNU0vNFkzSHU4?= =?utf-8?B?V3VUMFRJOHoyRlAwTUpscjNOWlMrV3ZQMGxxOGpIMUZRbE9Pa09DcTF6cFNY?= =?utf-8?B?VERtL0FUellpa0tteVc0NnFVa1lMRWRrYWRvUml1TE4wdlozVGM2UmdaVHFX?= =?utf-8?B?VnI3UXB6d0lkb0FCRlVSdU8venpBMFh5WERENXQwc0FXOG1yRWptbWRPbE1n?= =?utf-8?B?dkI5UWxScmRneGdmWkJCWHRzTTg4bFJTZndDbG83TDQ0ay9LOU8rSndtTmtk?= =?utf-8?B?aXFmQjgzaE51Z0c5bm9FUWY2dG5vSE9tUEhhMU1YTHhmT3Nld3pRRVZjSUlH?= =?utf-8?Q?LgRsGUyWyLAPOzeLd8VCUWsMPdczJRUT9D+Qo=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)(52116005)(7416005)(376005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cDZvNmFibnhTVDZEb0NpakZwKzJCbm8wNU5aR0d4T2tMYUFwSERWUUxacmxx?= =?utf-8?B?c3V4TmVWNHpWZWdWVzlyaTdrR2pwUFMyTjBwc0FUSTl6VUp2b1F2Q24xcVE5?= =?utf-8?B?OHFQbm96a01PMXQ1bXNXV2xTek8vSm9VSEd5NXZqNnl2R0JldlAwd1B4WWtP?= =?utf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MWd1a3pnU3F2QnhoK3k4VTFZQml1alIxNXNlQkxG?= =?utf-8?B?elY0Lzd3aFlqdHB5VG5TNncrWUg3SVpUV0YrYkhiYzF0NU0wQkQrbDY1QnFP?= =?utf-8?B?QUU0c2EzTFpVOTJoZHRYNmdpVmJLbmhaeHZKYnE0bUhUNFE5QUk5U21uYVgr?= =?utf-8?Q?vfyGxGNZKkduzNzMELAK2Gje/?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b200d19-f7e4-46c0-a449-08dc6c3c4bba 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:15:40.5200 (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: kTB7cM73P9h5jqKaR9YGbwVTQwji2+xZXBGT2FJE8I8Ox6V09qZ1W0fqCU0ax8qp0sCNCd/aXZ64mGZHFKS8kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8633 From: Peng Fan Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index f0cad2c501f7..df3e5d82da4b 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -268,28 +268,23 @@ static int s32_dt_node_to_map(struct pinctrl_dev *pctldev, unsigned int *num_maps) { unsigned int reserved_maps; - struct device_node *np; - int ret = 0; + int ret; reserved_maps = 0; *map = NULL; *num_maps = 0; - for_each_available_child_of_node(np_config, np) { + for_each_available_child_of_node_scoped(np_config, np) { ret = s32_dt_group_node_to_map(pctldev, np, map, &reserved_maps, num_maps, np_config->name); if (ret < 0) { - of_node_put(np); - break; + pinctrl_utils_free_map(pctldev, *map, *num_maps); + return ret; } } - if (ret) - pinctrl_utils_free_map(pctldev, *map, *num_maps); - - return ret; - + return 0; } static const struct pinctrl_ops s32_pctrl_ops = { @@ -786,7 +781,6 @@ static int s32_pinctrl_parse_functions(struct device_node *np, struct s32_pinctrl_soc_info *info, u32 index) { - struct device_node *child; struct pinfunction *func; struct s32_pin_group *grp; const char **groups; @@ -810,14 +804,12 @@ static int s32_pinctrl_parse_functions(struct device_node *np, if (!groups) return -ENOMEM; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { groups[i] = child->name; grp = &info->groups[info->grp_index++]; ret = s32_pinctrl_parse_groups(child, grp, info); - if (ret) { - of_node_put(child); + if (ret) return ret; - } i++; } @@ -831,7 +823,6 @@ static int s32_pinctrl_probe_dt(struct platform_device *pdev, { struct s32_pinctrl_soc_info *info = ipctl->info; struct device_node *np = pdev->dev.of_node; - struct device_node *child; struct resource *res; struct regmap *map; void __iomem *base; @@ -889,7 +880,7 @@ static int s32_pinctrl_probe_dt(struct platform_device *pdev, return -ENOMEM; info->ngroups = 0; - for_each_child_of_node(np, child) + for_each_child_of_node_scoped(np, child) info->ngroups += of_get_child_count(child); info->groups = devm_kcalloc(&pdev->dev, info->ngroups, @@ -898,12 +889,10 @@ static int s32_pinctrl_probe_dt(struct platform_device *pdev, return -ENOMEM; i = 0; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { ret = s32_pinctrl_parse_functions(child, info, i++); - if (ret) { - of_node_put(child); + if (ret) return ret; - } } return 0; -- 2.37.1