From patchwork Sat May 4 13:20:11 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: 794804 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2078.outbound.protection.outlook.com [40.107.22.78]) (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 C750E2110F; Sat, 4 May 2024 13:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828561; cv=fail; b=n5KIhlAslUWQRQGwSgO3QhiJTHYb58z+oAkXDS631V42Wp4X6Ohwng5Apu6b/zq47Rj5kKOONq08LJkD/KE/xrYwWXfdcl5xYuY0Z/JNbZk5DAtakJniOJ7Bb6FoW0N7t6qAemcIedE9w3tNaUsXKT9+tsUkyvUhPWGvvAjHy6Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828561; c=relaxed/simple; bh=UYDu+QLrZ0SSLpWHuRHRNNZ73xp3uVF3FfCqwL6cAd4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=i3iLvfxfl6Z0NnaVCSbMkDGL8/ZqC9W4zcseDcsNF5eGCLlBrld1LNt0dIi4r2I1EzDjv62VDyUGA85NSYwkjRE/CAFElf7cNtfT4GHh/W5h+/Q1Ld7iSCpfql+U/frmL7aVY2yoYbPQH6tMUwB8mb86NJfiT6Py81PyjdYZlP8= 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=EVS5HR5x; arc=fail smtp.client-ip=40.107.22.78 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="EVS5HR5x" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lee+JnAzlNvpehCxhyFAeNpuVgBeieK0ADvhiJEQqhD5hrggv2Iv+0N7RubufUMVytEBTc5Z3PorTPlZQzy4on0VDWXW5O3GGi3eunGf6u8W07OKRiaMybHa6Y5gjwlJYyrivI/aFHaQEEl1THvLGBgUKsxK4PrZs60drZ4aXox2/BTK5RdlHZHofGyMOfeHw4o8PvmTQtHPWcgZDJj2Wez3FtOLBNsbl4ywsj56D3xzm8hci8kdUH5IhQqDFWLmpNNvF7UHiNdRzeDOf+t8JAxIolN9NrEYKsLnNqbQIAL2fhW83h4X9KoENDLEtBQvkFCAX3qmE9UBLfIEJxWzHA== 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=Wh46VIFFtnR87VP8CR7uMzRt81dfHvC2gK19Gu2CtGM=; b=aEj/6j9IjzSd7KybfPLL3ptJ9WKdL0PYHrUkCXghiSmDOzxXraYQqc4iO9uTppTMoEhk1KAyvoWlN5KXwB4yWjClQoH+Krx5fBgJQu4to/2epChjSQoMNZceMY5Qtn8g5tr1QyqXgiXLku2vHu5tIAZZfKqd+SxOQiZifaagg4eXRLTOTAplderools+hJbX+qAtUxX3mTmz/15yf9jvxk2ftcyEqsj3tA7ZiUhGew41dZIxE5wASVm+7bDyCCkG8SnwS489nBvEkIYHOyOKRn/uqHpqm+pfnxnXy9xmSr/8LOpPCi0GLgi5iUJuupPbEBXdHA2T7ytaQZO3HHeCsQ== 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=Wh46VIFFtnR87VP8CR7uMzRt81dfHvC2gK19Gu2CtGM=; b=EVS5HR5xT5AFA5dsCbKK5mnP37N6m8GiH3ZoMhDe710IfMnodKMRLnfDYtCYSuzrxxLvkKC47feDQoHmqZkUF4OUrFP3o18J6dUNoJmL/+ayPxkANvxAPQMDmIaKB70JBkCdxI3cANfhpsRHxTPMF//ttNGowaREPSakeoEQ0pw= 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:57 +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:57 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 21:20:11 +0800 Subject: [PATCH v2 13/20] pinctrl: nomadik: Use scope based of_node_put() cleanups Message-Id: <20240504-pinctrl-cleanup-v2-13-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=1905; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=x+RKtlqeCysZbUAk0csydxI+b9I02cK4F7LOISGb+DM=; b=JE8/0bWFt0FhuoluAmwXD7cZ1NKNXM1V4n4g+hFSwn0VVc4ZZ5ApyeZfiWy4V4lQKgKKWENdl 0jAfiJK0OOcCjOJmK2qZEUZh4Q54eqOAxtCinzihJGth/uc8xGvAO/J 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-samsung-soc@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: b70a4f8e-bdcd-4b57-d0c5-08dc6c3c55ab 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?q?E5L+BUqm+vMSm39Frp2SuehsVN8rEIT?= =?utf-8?q?hY7ZMM01GEoGLC6k6YeX5XllaTW9jRcuSCWvIV2jtcWj9SeOyG3uDbG9WD5WCoxoR?= =?utf-8?q?AuzkyV2fRKS/Mb4GEwcNgMfSDLECcSw6zPLTwDwa78xT1QGWHul9deAvt2kI8gKUw?= =?utf-8?q?crxWDxv+E7kh0q01rjV9TO4H3fY98rzWyTlhepRuEXKaZ17I3bbUrig3/kW25W0BO?= =?utf-8?q?JJ2F4YLdIBenCI4lgQoscPaPaX4UrmFhN9rYnRGXyn3dHUf9vQN7MRtINa1pYAEfn?= =?utf-8?q?GgmI4kBBjrKsCQy8SkT1HY7Cfs/k6W8ZA7m7gHWQJPyPMN2zQxcLUhlBAL0SAUmVj?= =?utf-8?q?MA+T+j+f2ELxeNWqrPCdrQ214nVhOgb6fYEZkVlkRke/Mw8onWUI7tdKnIXu6RoQ9?= =?utf-8?q?xClTaL+WGsTIAa8LDfYjh5lwheWFKdomC9MbyaePkr3cLEYbjEuNC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S1gner7m8WWo=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?q?hQdK02yXQN/9HxCbZWmr3b4JRblo?= =?utf-8?q?c+RjuiwF8GSFTWRBfClDkRcNBD1io6ZDEvMjr7moX4b8c0QGuqWZcPWVLabsqoMyZ?= =?utf-8?q?aiLGMIPpTTf2kPjY82YrQ1d6zdl8Cu5w3Zl9UG6YgVMxGRB5qcYKHh5Kv4Bjxn9RK?= =?utf-8?q?YiYwrnTeEfxMoXamOyOXE1q8Ttp6V72R6qoFVfMkeeGfO0eRXxZS1mgULZ/4XItgw?= =?utf-8?q?oiCXZEgmChAHcM23AoSV/9CW9fVKvJ7vHTurKvJhOMiN2ieaDruuuwMPa7Inflmvf?= =?utf-8?q?IJP5GBKNooZ3thbeAUHbGmziJnLqzrjrn2RzZUrcdGNhZpz/iC1IyZ2oN/FWZrype?= =?utf-8?q?GV31Z8GOAkZ7wQac6ebGIO0zMXTMS+fo447SZ+uv58iZvzCoLC/d5yyt2PQJYpo1G?= =?utf-8?q?rgNxZb1Ygv833Q69SPTBaQTsX+nZh8GFuS2A35//hBTm6XvOwBB0+IoACfZy9XOLh?= =?utf-8?q?7yHtvPul90yHGMrHkMiXeFXGpqRhFCeAcQsWZ3RkaUfTEeEoepLr0GQFKfskK/f7u?= =?utf-8?q?wCvpE1cyWnezB3DjngW/R4afnWDr/UvOflmHUW4FicedbqdXA8OwXDpSujHYhoqdU?= =?utf-8?q?Ds4wKH7bAxyyYd7loQzdNo5apWxYeOwRJZIY44ZNZroA2KG6WpM+YkG2dK3C0XpbD?= =?utf-8?q?72RWnPZ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8?q?k/x3SCy4hua6?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b70a4f8e-bdcd-4b57-d0c5-08dc6c3c55ab 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:57.1871 (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: UNrCeNgMIYVy+8heMkCZBvq6g6j6oQC/D98TXd5g78WaLKxK+Hl3hAFwJCgy7l9LEl9URhHECQ/dXLSXji+JsA== 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/nomadik/pinctrl-abx500.c | 4 +--- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 80e3ac333136..47f62c89955a 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -811,19 +811,17 @@ static int abx500_dt_node_to_map(struct pinctrl_dev *pctldev, struct pinctrl_map **map, unsigned *num_maps) { unsigned reserved_maps; - struct device_node *np; int ret; reserved_maps = 0; *map = NULL; *num_maps = 0; - for_each_child_of_node(np_config, np) { + for_each_child_of_node_scoped(np_config, np) { ret = abx500_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); if (ret < 0) { pinctrl_utils_free_map(pctldev, *map, *num_maps); - of_node_put(np); return ret; } } diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index cb0f0d5a5e45..fa78d5ecc685 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -804,19 +804,17 @@ static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, unsigned int *num_maps) { unsigned int reserved_maps; - struct device_node *np; int ret; reserved_maps = 0; *map = NULL; *num_maps = 0; - for_each_child_of_node(np_config, np) { + for_each_child_of_node_scoped(np_config, np) { ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); if (ret < 0) { pinctrl_utils_free_map(pctldev, *map, *num_maps); - of_node_put(np); return ret; } }