Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp407785lqh; Sat, 4 May 2024 06:15:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIltET5rBylTM+Xn9SlSOakLBZ5GTt1w7UeS6QQbaTzxYKjtA1qr3G5MYzDmI6La0qAGLBSvQST8kBMTItLnih4SiT/K9rWOSNO/XVnw== X-Google-Smtp-Source: AGHT+IGX8qhla1A7Lpsb0AAaKeAX/B1MR8Cc5G7oaE27HvEQVDb4mnKnoDQf0ZgiIWgqmKodgiEx X-Received: by 2002:a17:906:ccce:b0:a59:8492:53ae with SMTP id ot14-20020a170906ccce00b00a59849253aemr3504145ejb.44.1714828500275; Sat, 04 May 2024 06:15:00 -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 g9-20020a1709063b0900b00a58764ced50si2571773ejf.333.2024.05.04.06.15.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 06:15:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168676-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=Dj+fXKXO; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-168676-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168676-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 CE2F61F22226 for ; Sat, 4 May 2024 13:14:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5771E2E414; Sat, 4 May 2024 13:14:44 +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="Dj+fXKXO" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2068.outbound.protection.outlook.com [40.107.22.68]) (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 79CB72868D; Sat, 4 May 2024 13:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.68 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828482; cv=fail; b=Zmd9D4oFaKyrBZSlCFp0F/jfrCzQ3f7/JdzYjVvapc3t3+6wYETvP/NG4YL/ajHIebw3bJYLJO81EufoA6aaHn0egBlQkfrS5D4Msobh9rBKy63Xms1/0boCMnS026eBG43qcyo+peCVdvm0kplq8rPXuJ0YP5F2jAvXkJ08JPI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828482; c=relaxed/simple; bh=9hvlVy6b1eo5pxJBgdmpuQ0CR5gv9409rTkOxz7XFTQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=sYO0t3YPqO+LEE4m4J5NG57Ejxb0/EU80m3ibtAI6rumv5yCi2h+raAbfgL4lrIWu77QNvRQGfBsLhejD9FCLg2PLYDNT2+EIf1K9KKvJR/zOS0ewuapQR4aYNwDsVWlVvqzfhbkzbyrArWJJQeSQh1WwuJF3UDlkLKB6IXSpvo= 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=Dj+fXKXO; arc=fail smtp.client-ip=40.107.22.68 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=fWXn+HNPyiNYRoDQDcAcXp4xArKAw/y8SFe/oayt6TItkT60kYUvZw3LsUO5+w8cIdM28YEM0q3jSoDZjWtLjKH1vMktTx9G+Rp5tw8tG12E6+Jkd1fCM9BArtum/H5wgxpfn1Bb95X/Ews/RyLiMruVN8cDELzVsEVzY1UZR7wDnWfqeWkTRZsRQul+UTPmSVatWS6CuqONLusUSbHNXhVzqEp9DU8Jpng59kI0wbZ+aka+RHpz8K7LuIDqhqXDn7JAlA+XA8ctk8Rejq5LcG4LSEBMHd/ol1CU6A6CLYrBkyC1MCdthm5B6uK6B7xi9RiEmCOL7f4rpMLgcjOnng== 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=epf4L/dpti+hg620NqhC5qYH7xMXGAi+pTHVtvEELiU=; b=AW82+A8IJYGHbQJto/aGxXBevTqLMwgnJF8ET8BsnuEFzN9iskxYO6ib6PxRmfaZWPiWt+n7+enL4Qs1oUPPHwzPF1+IRaClEHwU23lvKPCVfhAMYmdw+FVBMlmjAwgWulJcaoSsBR6Km8JFlf2uVzuu7QM8GYd2DQ3zFM832wieBJatzEggMThrR7I4RlTruCweTk3JYo2qhhEAjP59J+lNCok7UKn5smB2TedoHc+hkW6nd0R5dqf42vkE5U7Xj1B0UMBl8jxKKFgS8AURB2VnJwOhyz2TPbFrjS1u/vt8ZpXUjNbcRJHiu5uloSUKjJAVtMndf/iI34wVaebWSA== 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=epf4L/dpti+hg620NqhC5qYH7xMXGAi+pTHVtvEELiU=; b=Dj+fXKXOBD1vI5VZVLaZnuBzZPwOSlnDkyrIq5Iit8VQPl/2J45TnEi8RICFxnOSUXd56kwto8odRlP5WmKXOXHlN4n/sHVH7BL856t0WxL5kawMYOTMcVZNHJ10JhXQq8plNmxx/hBcrYzNdjuJ6B0Oi//pM+j3bXhvDZtgjOQ= 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:14:33 +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:14:33 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 21:20:06 +0800 Subject: [PATCH v2 08/20] pinctrl: st: Use scope based of_node_put() cleanups Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240504-pinctrl-cleanup-v2-8-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=3917; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=WkwqgZKiLgnl2jfID+Ud31pueZUfzLGyRuwnbdcTMcE=; b=54q7MBEBsmgWVOdKQelInf02EJz/WtXPNBQuDk5mK2LcLLCBCOXVl32net6pxq9g8cBTu/cs8 PgTb3cxhzI5C/dbPij4nnc9A51CT7/Xx+UEJuEZwAX3+3Z+P3Zwv4ES 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: 9f5ee1a4-bb1a-48ca-a0c5-08dc6c3c23c6 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?dndIdUpNdDhGZmJpNlBSRVNKekRYc2ZUajhFMDlENXd1U3dYTTJEUFpSeW1v?= =?utf-8?B?empJcSsrN25RWDVBa2lrQ2V4bTlHVFN6T2Q0THJ3YUFBTUxyWkZyTDU5MzVM?= =?utf-8?B?Wm9JbWpxTzVES09wOThnNDEzSEtyb2psZTA0UVdqMVZjRCsvcHRmUU9nWTlC?= =?utf-8?B?dnl4Zkh4c2tEZVFuakZCZitjeDNqOTRHMFdYNzNEdzk0ekpjQnBWVmdQNEVy?= =?utf-8?B?ekxOb2p0UUhrbTBjRktPTlFFVU5PR2xKMmRvNU1OUkpHR0RmMUpwVmxlRGZD?= =?utf-8?B?MkZyM3ZJV2lSb2R3aFVhMm4xeFhNcUR3aTFnMHNtbk02VmlmK3lxNUt1Tm82?= =?utf-8?B?Um51WGs0T1lReGNIalJEa1BwMFNxWWF5ZkNLcWRldVBTYkc5dWU1U0tkdGxE?= =?utf-8?B?THdmWlBRY1BoRk9Md0Er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utf-8?B?MUtoQjBZZ3JEUHNBbUprWSt0cTJiYWsyTE1mSHZvVWFwOGNEb3BSMGJ3eWFR?= =?utf-8?B?L2puZ2FZRko4T056N0dFb21UY051M1VpeVpMRndQNkhXVzIwNTJRaUVhS3Vj?= =?utf-8?B?TUs2WU1acys1dWpiU25XakhGWndSVy8xY2VsYVpFQ2FUN2cyTVFvb05BMktq?= =?utf-8?B?aWU1cGNQaERVeXdyVnZHSW5JUWJrNUh2RzBpQklqaEx5TkFTdW9TSEV0SDNS?= =?utf-8?B?elJuQm1TNFViMmlJQzYzREJvcG1aL3B2eXBjZjJjRGthcDZjVEdtMWg3aG91?= =?utf-8?B?WEdHZ05JSFlLZUQ0TE5WUUExZDc2bk9JQklGY3lvd21Sdk5xR25MeENlTG15?= =?utf-8?B?QVQ2aDNXVVpNeXVZN09uVEpoU3h2VXMxakRlVlhVMnlZY2dGYmdjNG5paGZ0?= =?utf-8?B?Q2pkMWZsMzdYdnEzNm9iSWtHMitFZnVEOE1CLzY1QVl5NXRZVkkvTUR1bnl0?= =?utf-8?Q?DjelFG7iO47a6QAQMfnjcLCWggrfmndhlPIQc=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?R2FEVGxmNWtFdlJ0S25BaFJOZ0xjYTZlWmRQMTB1SU56Snc3STFlRkgxYis2?= =?utf-8?B?YTAyNTVPaVBBbnZlZ3RvdjIyZDQyQTZibTFoRThOc2dYbUhqR2pqUG5GS1FU?= =?utf-8?B?QUZPcU9Wd3dVWXRCY09KY082ckxOMVNKQlVZRWJneC9sVTRUODR0RjAyNFhq?= =?utf-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GN1FWbWNNOHplWDRUaTV1SnI3M05IL2lNRjBk?= =?utf-8?B?dHJLTWQ2YWRGYmVNaDBCUmJPSzZSNzRROGpKZ3ZXa2ExK0hKeEpjc3JTZDVt?= =?utf-8?B?c0xtc3NrbHBLRFg4V1BuK29sbHpJZjdKUlV6NkN4SkhqVUludlVMSDcrYVRP?= =?utf-8?Q?eQ/3zzyoUuSI3gnMabyiQmTmK?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f5ee1a4-bb1a-48ca-a0c5-08dc6c3c23c6 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:14:33.4684 (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: cffexWyhFxcbCs7yVHPCRoKq8Hz6oeRtownJutulL+N/e5mtXIytW8fqu18Jm+yYgRBqEfJGqV/mzLUkkQYPDg== 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/pinctrl-st.c | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 5d9abd6547d0..fe2d52e434db 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c @@ -1195,10 +1195,10 @@ static int st_pctl_dt_parse_groups(struct device_node *np, struct property *pp; struct device *dev = info->dev; struct st_pinconf *conf; - struct device_node *pins; + struct device_node *pins __free(device_node) = NULL; phandle bank; unsigned int offset; - int i = 0, npins = 0, nr_props, ret = 0; + int i = 0, npins = 0, nr_props; pins = of_get_child_by_name(np, "st,pins"); if (!pins) @@ -1213,8 +1213,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np, npins++; } else { pr_warn("Invalid st,pins in %pOFn node\n", np); - ret = -EINVAL; - goto out_put_node; + return -EINVAL; } } @@ -1223,10 +1222,8 @@ static int st_pctl_dt_parse_groups(struct device_node *np, grp->pins = devm_kcalloc(dev, npins, sizeof(*grp->pins), GFP_KERNEL); grp->pin_conf = devm_kcalloc(dev, npins, sizeof(*grp->pin_conf), GFP_KERNEL); - if (!grp->pins || !grp->pin_conf) { - ret = -ENOMEM; - goto out_put_node; - } + if (!grp->pins || !grp->pin_conf) + return -ENOMEM; /* */ for_each_property_of_node(pins, pp) { @@ -1260,17 +1257,13 @@ static int st_pctl_dt_parse_groups(struct device_node *np, i++; } -out_put_node: - of_node_put(pins); - - return ret; + return 0; } static int st_pctl_parse_functions(struct device_node *np, struct st_pinctrl *info, u32 index, int *grp_index) { struct device *dev = info->dev; - struct device_node *child; struct st_pmx_func *func; struct st_pctl_group *grp; int ret, i; @@ -1285,15 +1278,13 @@ static int st_pctl_parse_functions(struct device_node *np, return -ENOMEM; i = 0; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { func->groups[i] = child->name; grp = &info->groups[*grp_index]; *grp_index += 1; ret = st_pctl_dt_parse_groups(child, grp, info, i++); - if (ret) { - of_node_put(child); + if (ret) return ret; - } } dev_info(dev, "Function[%d\t name:%s,\tgroups:%d]\n", index, func->name, func->ngroups); @@ -1601,7 +1592,6 @@ static int st_pctl_probe_dt(struct platform_device *pdev, int i = 0, j = 0, k = 0, bank; struct pinctrl_pin_desc *pdesc; struct device_node *np = dev->of_node; - struct device_node *child; int grp_index = 0; int irq = 0; @@ -1646,25 +1636,21 @@ static int st_pctl_probe_dt(struct platform_device *pdev, pctl_desc->pins = pdesc; bank = 0; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { if (of_property_read_bool(child, "gpio-controller")) { const char *bank_name = NULL; char **pin_names; ret = st_gpiolib_register_bank(info, bank, child); - if (ret) { - of_node_put(child); + if (ret) return ret; - } k = info->banks[bank].range.pin_base; bank_name = info->banks[bank].range.name; pin_names = devm_kasprintf_strarray(dev, bank_name, ST_GPIO_PINS_PER_BANK); - if (IS_ERR(pin_names)) { - of_node_put(child); + if (IS_ERR(pin_names)) return PTR_ERR(pin_names); - } for (j = 0; j < ST_GPIO_PINS_PER_BANK; j++, k++) { pdesc->number = k; @@ -1678,7 +1664,6 @@ static int st_pctl_probe_dt(struct platform_device *pdev, i++, &grp_index); if (ret) { dev_err(dev, "No functions found.\n"); - of_node_put(child); return ret; } } -- 2.37.1