Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp409064lqh; Sat, 4 May 2024 06:17:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvkgeCfYk6jasz28SqXnZCd6NFcCfJJWD5HtxZO2HoITJ3Nn++VHmSl8ThfApiE7m+dmYmZBVm7q8xaqNmnkoUuo7dd6aVOYIa+XrplQ== X-Google-Smtp-Source: AGHT+IHFsgyltgfJtG9PZ2TQ2SFtlxBgCF5B2Vjk9hZzcOh5s0Iht/PcxLiFe+94qVl/WrEcPauA X-Received: by 2002:a05:6a21:2792:b0:1af:6730:9e86 with SMTP id rn18-20020a056a21279200b001af67309e86mr11531604pzb.3.1714828634529; Sat, 04 May 2024 06:17:14 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id by35-20020a056a0205a300b0061c988ce083si3577269pgb.473.2024.05.04.06.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 06:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168685-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JwGL8Zs6; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-168685-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168685-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 26CA6282E74 for ; Sat, 4 May 2024 13:17:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62CCB3D0AD; Sat, 4 May 2024 13:16:37 +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="JwGL8Zs6" Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) (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 D886A39FD7; Sat, 4 May 2024 13:16:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.58 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828595; cv=fail; b=AaTH6O6L9AHh7l6mo980Lpwnbde0XBjPgw0VCysAOqqJdgbFLfBRfi/ThHCNXNh8R7AdiE4Gy8g0jjfyqjfkZNWEM1dtzqfwgjfBB0l/7lhPCt44n5d/7It3zCbUUBLKOIg2T3nuMsWLFcEmJLwxvAOA1sJqhC2IRjwc+o71ozI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828595; c=relaxed/simple; bh=7oLy/VNXv8mod/yO9pa5qybVbR+daZZ1X7hIX56xPZk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ljsrVEScI7pvf0iAnssomqYaC8TZdcJPfbhF1BGOvNaboObH2lAX6xq5LPk+JvZvj6KvMSqnHcOirIucFBPY8rPcowbOtXKXSXFilCDc+eCmExKmm0+nVxNyd8pOUh0dk6bxTOTGpZIesgarw1bfAXY7mqNw/Q7ThykGMaI2xQc= 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=JwGL8Zs6; arc=fail smtp.client-ip=40.107.22.58 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=LIMM1EBcMpsAfoIajRF8lWxzqD5W5hV8CGR9eAQIs2T1oAhTOaKF0HCpJcnlc8sroJw018a5EyhoY5IExC3qqM/iF61FMdZnyHLMLCHhq+o3yrexo0iu9Xr6TXSyls9xJcIV9CfYgZ+X/aCnw1tL8enOeJjt4t93iHXGazwvHkTRL9iCy39v8F84rGNy+ty1x9SjkVGouTe9sqS0rH8auDRgN7zXZLuVBTATTG/Q+EUh8bsjNjHp+HpDHsA7LAmZVOH2dIy2QjpI/oaqPgOrLmimERTvp+7q6Ez3IYJqHLdlc4/GhQ5pFdeXTBNPcjCVidkv+cXMKY7URRnZ/9XmTA== 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=G6JJzIlsATPz+eeVRC+tmQRXVLBCszxKxTWLO7z/7Rw=; b=iIBs6qs50gXDdVnot+R0Tt18PMfLYan0y5eX4WWZBZ6Rmn1OplAcASf2Ui7+GWnY0XYgH1qEIPRphOElHqDmFQ0Zwp6kIoZEpOkkA+jGHrU5kIwPxWj4a7Qfp9QyPyfzFcR/YpluMQWUoDneKgvXgDhQd5yzbpvUzSm9pGJU/ZhPNAtVfq9FVVodtKKzBKFkmrN+CHcjg6/6ldPW3ecglLQ6llosWZ/4FQCY0rikWyE9gVaYAfal2h9nPcS6PsLMFvNrT7JYHLWHqWyNYPCV/oFruvx2k2GN5W83t6C/Kc8qRswy4wIevZm6SgryLF3MhM/fbgDlE6Q6nM9FCbfr1g== 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=G6JJzIlsATPz+eeVRC+tmQRXVLBCszxKxTWLO7z/7Rw=; b=JwGL8Zs6PoyHk+U+trsx6DmiL7Uh7CdB7QXcgZ7fwYsKtjlQTGUndTL/ynWE1SI9AmOVt8aHUAITzcJGJjBmYWjzAdmi/zHzu3mXgciACNlrVtknBQWSZS3t4z9FZHrkV8M2dvU6mytpNprf/CaijdDfxEEPyGCXAiuTQK0BNhs= 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:16:30 +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:16:30 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 21:20:13 +0800 Subject: [PATCH v2 15/20] pinctrl: freescale: Use scope based of_node_put() cleanups Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240504-pinctrl-cleanup-v2-15-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=5535; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=CgYPpbd8zRZLHMaSBUod3MJSkUGYYuTkn7XHxXWmDfQ=; b=QThPNXw7bxO4a7RWVR+x8/it3yFCdDCIJhct6pJk1X4WfCzb33CCZ6xXajsk5epDPQ/hH1F0c spUFq/qYsKOCFwSsFFp6AnQ0TVEi4pJVnIpdLi/K9c5op0pxw0uris8 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: 826172fc-8f7a-47ae-4b44-08dc6c3c6988 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?b0NFTThrOXRSN3EwQjAvZkc3RXhFUUNRUTVsMUhGQ3NrTEszcU1Gdjk4MkZS?= =?utf-8?B?MDRMZ3Ira2ZrdGpkazdCTE5Hd1Vsa1hmbzFSYkVYblhWTmp0Q0gvWWlac2pI?= =?utf-8?B?T2dub0FwVUJ4dTBVY2hSVWpvZGJjTzFrbDlLVHhqaFdtaTYxdk9UZElYZE81?= =?utf-8?B?ckRzZ1loQTE4aGtucm9Cc08zK29iWWVUUjhIZmR3MFVlMGlzc2ZvV1dsNlpa?= =?utf-8?B?UDZQN0VxOElMRkZydGU5ZkNDRFFkc3lJNVBoSjhjdldUTUorOFpKNzdwNzRI?= =?utf-8?B?aC9YM0phWlNwVmVEZkc1UElrM2t5L25IZ3I0eE5Yc2x3ZnpENS9KYVBaQnpo?= =?utf-8?B?ZXUvNTIrSmUvNGh1QTZBbWN5dkhZS0FvQVFEd20yN3VmQmdodzAreWQvZ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9wZnVtK0wxNmhyNnJZY1BJS2Vu?= =?utf-8?B?c0wxS2hxV3NDZ0R5aEJDNWNqMVBCQ1hnNzg3VUhVUDVCa2tLWVhzMmNUYTJB?= =?utf-8?B?WHVHa0kvWHFhTEI3WVdINUtsbnY3SkJSYW9XalhaOVFLdkVxc3FRN1lDSUxz?= =?utf-8?B?VnFUUlRTQWhDbXNHRXB4MlRXSjhBc3VtQkpqWjlKRHRTZ0gxUzBuQTNrUEJi?= =?utf-8?B?THRnNEE4VVZNZ3ZQS3FsNXUwcytGRXE2bDVyYlBpa29TKzJwSnVoNlFMcUlw?= =?utf-8?B?dndXTVl3VkI3NDlmSWxUVjlnM3FsQ1FaY3dnVGY2V2dOUzhoZ3RoYXBhalFr?= =?utf-8?B?WVJ1UDNJU3Zzdm1GSXR6TVppRGNtZVlHUWhzYWxWMTB0VzZYaGhTL3J1TGYz?= =?utf-8?B?ZTNNQy9XYmIwQnZ6NmY1Q092MUZERzhad2hZK1Q2QXdERFFRQlNXWXNKUWlG?= =?utf-8?B?Ym5UVEVIUEJRT3FXemp1UVowalhzN3ZDSnFOdGFvU0RhVjg5VURTY0Jqb1lm?= =?utf-8?B?M3VwY2hrQkFiOG9wU1ZPUT09?= 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?OFJXV2MvS3RwbEJTMlVDc1hadk1mYUZJUm9kMlN6MWxpbUtGelN5U0pWYmhJ?= =?utf-8?B?bVpJbzE0SGNBWnQ4VkY0bzBIZEtXQjd2T3o2MUF1dkkvM25JdnlhWjF4cXNU?= =?utf-8?B?ekFucjlwc2ZxYVRGaWJ1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MlFv?= =?utf-8?B?SXNvMU5Kdms0MkZiL2xER1E5TkRKaEVmWDhENWNUb005MFYxdDFHRU1vQkZP?= =?utf-8?B?ZEJiODB0ZG0zbW1FWVgxc2xRaFkrS05PaUxCc2VCWW5HNEJPbkVpUE4veUll?= =?utf-8?B?ODBUTUZicW8zSmxNcVhwZ210SEtKdnFUUm1DcjEzbnNPZEczN2JHQVRQUEJm?= =?utf-8?Q?flGCiE1iMzSEktcOEaBrvJCgZ?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 826172fc-8f7a-47ae-4b44-08dc6c3c6988 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:16:30.5045 (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: vZZ7kr3dkSjhuW6rezuQjtYbweUoIm8juzVfBE1tlEK9WX76tRZQ7SkDKVhXwIHJQ/qGFmQ99JQhT5X1sU2CgA== 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/freescale/pinctrl-imx.c | 25 +++++++------------------ drivers/pinctrl/freescale/pinctrl-imx1-core.c | 16 +++++----------- drivers/pinctrl/freescale/pinctrl-mxs.c | 14 ++++---------- 3 files changed, 16 insertions(+), 39 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 2d3d80921c0d..2b7448e3cd65 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -580,7 +580,6 @@ static int imx_pinctrl_parse_functions(struct device_node *np, u32 index) { struct pinctrl_dev *pctl = ipctl->pctl; - struct device_node *child; struct function_desc *func; struct group_desc *grp; const char **group_names; @@ -605,17 +604,15 @@ static int imx_pinctrl_parse_functions(struct device_node *np, if (!group_names) return -ENOMEM; i = 0; - for_each_child_of_node(np, child) + for_each_child_of_node_scoped(np, child) group_names[i++] = child->name; func->group_names = group_names; i = 0; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { grp = devm_kzalloc(ipctl->dev, sizeof(*grp), GFP_KERNEL); - if (!grp) { - of_node_put(child); + if (!grp) return -ENOMEM; - } mutex_lock(&ipctl->mutex); radix_tree_insert(&pctl->pin_group_tree, @@ -635,21 +632,13 @@ static int imx_pinctrl_parse_functions(struct device_node *np, */ static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np) { - struct device_node *function_np; - struct device_node *pinctrl_np; - - for_each_child_of_node(np, function_np) { - if (of_property_read_bool(function_np, "fsl,pins")) { - of_node_put(function_np); + for_each_child_of_node_scoped(np, function_np) { + if (of_property_read_bool(function_np, "fsl,pins")) return true; - } - for_each_child_of_node(function_np, pinctrl_np) { - if (of_property_read_bool(pinctrl_np, "fsl,pins")) { - of_node_put(pinctrl_np); - of_node_put(function_np); + for_each_child_of_node_scoped(function_np, pinctrl_np) { + if (of_property_read_bool(pinctrl_np, "fsl,pins")) return false; - } } } diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c index 90c696046b38..af1ccfc90bff 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c +++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c @@ -508,7 +508,6 @@ static int imx1_pinctrl_parse_functions(struct device_node *np, struct imx1_pinctrl_soc_info *info, u32 index) { - struct device_node *child; struct imx1_pmx_func *func; struct imx1_pin_group *grp; int ret; @@ -531,14 +530,12 @@ static int imx1_pinctrl_parse_functions(struct device_node *np, if (!func->groups) return -ENOMEM; - 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++]; ret = imx1_pinctrl_parse_groups(child, grp, info, i++); - if (ret == -ENOMEM) { - of_node_put(child); + if (ret == -ENOMEM) return ret; - } } return 0; @@ -548,7 +545,6 @@ static int imx1_pinctrl_parse_dt(struct platform_device *pdev, struct imx1_pinctrl *pctl, struct imx1_pinctrl_soc_info *info) { struct device_node *np = pdev->dev.of_node; - struct device_node *child; int ret; u32 nfuncs = 0; u32 ngroups = 0; @@ -557,7 +553,7 @@ static int imx1_pinctrl_parse_dt(struct platform_device *pdev, if (!np) return -ENODEV; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { ++nfuncs; ngroups += of_get_child_count(child); } @@ -579,12 +575,10 @@ static int imx1_pinctrl_parse_dt(struct platform_device *pdev, if (!info->functions || !info->groups) return -ENOMEM; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { ret = imx1_pinctrl_parse_functions(child, info, ifunc++); - if (ret == -ENOMEM) { - of_node_put(child); + if (ret == -ENOMEM) return -ENOMEM; - } } return 0; diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c index e77311f26262..aee70fa55bec 100644 --- a/drivers/pinctrl/freescale/pinctrl-mxs.c +++ b/drivers/pinctrl/freescale/pinctrl-mxs.c @@ -490,16 +490,14 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev, /* Get groups for each function */ idxf = 0; fn = fnull; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { if (is_mxs_gpio(child)) continue; if (of_property_read_u32(child, "reg", &val)) { ret = mxs_pinctrl_parse_group(pdev, child, idxg++, NULL); - if (ret) { - of_node_put(child); + if (ret) return ret; - } continue; } @@ -509,19 +507,15 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev, f->ngroups, sizeof(*f->groups), GFP_KERNEL); - if (!f->groups) { - of_node_put(child); + if (!f->groups) return -ENOMEM; - } fn = child->name; i = 0; } ret = mxs_pinctrl_parse_group(pdev, child, idxg++, &f->groups[i++]); - if (ret) { - of_node_put(child); + if (ret) return ret; - } } return 0; -- 2.37.1