From patchwork Sat May 4 13:20: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: 794809 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2088.outbound.protection.outlook.com [40.107.249.88]) (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 4BF084A1C; Sat, 4 May 2024 13:13:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828394; cv=fail; b=UcULIoxD5YwMTqQt+Eju6lQpD3vgU/zGXUW0LPqE66mP6PusIev1JDdKbgsF0kuLGGQPxsEyrNB3xFDuFnz7iNjJuO75YDwmicpS0NX5/ygPWiDxatOizViHUmW/bUQ7DG7RGrKKoVr6wF+QPuu0fxFc2npC4TGYDXN5OtSsB6k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828394; c=relaxed/simple; bh=4kFV9K5wvGejwy+SJ2LKcCyxaJGa0mPSeiJjq47A74s=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=UJvRtmQtx+y61Kyhm2mj080YJFytnnb1lx6j54mPlAKk/KT16ywNeuB2B4AGpGzjHb2pYbUZyS057qpWLFQTrQr/Sn5mtTJQcdAWls9b7U6QiXYfXrk27LV3Yma2ixZvFSvpMSlWry4yfoO4G9hf78vVxL47j6A6CwiTV5VoGJM= 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=gw5ShpcH; arc=fail smtp.client-ip=40.107.249.88 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="gw5ShpcH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QcaVkUmsYsgy3hGwoc4viGWghmbmJckIyjk3VfgZyd0q9zykcuOT2r/Up0JHjRRSlaNiUuC+67e9b7cyrDO5Sz2n+Zq9fHPBwbDbbPjabh2l6lKIwGkgM8aOXyDbHdc+Mfi2osWQ3Rpvvl24REF5xLx2BB0BOW0q33p7alKyB1Rfxnf3s81JlFUP6NXETKywKjeLMO+InMLyLc7dnpetL+WqtcibgKLV8U3Yl/3IvsxbPEicFPN3udN1LbmkWnBMmEJv9pIxIT2Lee78Vnqd2W88RdVhcXjLJDphxU6nHBPxjil4fejb7CFw6k7VoxTt1jzzIGK5PZzt6Mo4uQMGYA== 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=TTUcWyDbCSVNKuwyH5CGkMM0CICuYlw4uOmY5Ln1Lww=; b=IzcjEHg3B++1mx9qN0aqRQmWrjGkJy1+oWQceAgzG+WmADqth92ecZ5z3vswxH5oEG+evbmIaZB6Y7z7HYBjdgChGEhQ5z6GJBGKt2Ad2BUtkbRr6CU9MCCs6s2VNUks/OZt4VUthFV/LMA7v/XlJRAl8SeIqd3saEd2Lzi+0ih1KJcw5wYLvxyCLaseo1sjcU2Us2OQLamOE6YOKy/ahK2+0silk14y1Vi97kfueW1MpJ1/iLQ4RuD8Uw6MXM6KIhVnBa54n7isYNvCVsDBOPZl6y++n3X9iiGDHqz1mzoxMxhysYITeUhO7n1c7NLB4LjKz2S2DyC2A6hTvmqrWA== 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=TTUcWyDbCSVNKuwyH5CGkMM0CICuYlw4uOmY5Ln1Lww=; b=gw5ShpcHbxX+/Xgfdkl6TAsvFPiMvIEC+Wi+Ae6nDPBN80+wYr5eN5N4wCs9HQdsZHVPCfURXlozR7QE89G8wt/kwGfWscEVp50pt1vIB1+dt1JzONplO4EaBHo6DN6kyJXhHSOlNQq/3TaVftMeT7o9rKj08S11oECy3aSVXqo= 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 PAXPR04MB8174.eurprd04.prod.outlook.com (2603:10a6:102:1c4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39; Sat, 4 May 2024 13:13:09 +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:13:09 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 21:20:01 +0800 Subject: [PATCH v2 03/20] pinctrl: stm32: Use scope based of_node_put() cleanups Message-Id: <20240504-pinctrl-cleanup-v2-3-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=1139; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=ghhx4F825SMq6fS1o6/f7VxGij7/D0TVS3p3q5rW72o=; b=W1ebSmJCvWCOZPu9H9k2jOBBLmE4aP3UkbMAeH4VFsI8NvpmJKE1fTQkEzyogXFOCywZ9HGuZ t/i1shR6m/HAeYvAKPCXfhOd309a+7YyiU7qE5UF2EXObsv2UvI//bP 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_|PAXPR04MB8174:EE_ X-MS-Office365-Filtering-Correlation-Id: a58bc258-71c9-40e7-3d3b-08dc6c3bf1bc 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|376005|7416005|52116005|1800799015|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Nbfv0wCQrmkFZ/H2CqFdPgmxPXJcqUv?= =?utf-8?q?2578h8N2IfdRjl56FN936oVTUG8wlV38ZZ8g/inHIgGEA//0t9JwI+HpWLLCPLeUP?= =?utf-8?q?51+VEuGt5mzqY1eqsTdvj2EEDhuLKnK4Nq7eVTxPzPzQqjjKbWAkaDI7w4tL/DQAF?= =?utf-8?q?mwU0JGtRJ5+cSAxr7LFWvNXUubUQN37ys1v5duagcvqDvdCY3rggvb8CsXDHrL+qo?= =?utf-8?q?sfrzn9Idd38l9fMxVfAsSqls3vrnny6whhuHsJUaWypiqW4u5RfAY4KFs/ShjBk8F?= =?utf-8?q?z95xO36dL/mSdFPexD+LMHeO8q4AZ84R9Niozr4REIn7DHIT2wdkcISR0mw1K6nY/?= =?utf-8?q?+E51VeO/2ltQD4xD/xO+Bz+QCn0RL+/d3wSGf/GTD1QhmfSH4mESgB3cVp9CmISAf?= =?utf-8?q?SZs3n3H2Bb/9+uba1wZzbTE2PTKFlQ1EKvrVoJ1CO/owphQ+jPdtLV0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2D8OiDcKzl0UYYCqO7Lg=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)(376005)(7416005)(52116005)(1800799015)(366007)(921011)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?aoHCj2Ekv80TfVrjn7hJXgGfxQjC?= =?utf-8?q?AFM60AlmRhcVU795omFMdy29KAkYxTElO9D1b4oxszXOiHRl6OO4PirsJGlxk4ZIp?= =?utf-8?q?6vdJoc11oNJnwjeC+V/l+NXcle05g9JqjR5nYWm44SjNN7JsryP+nqfKpV6cFPRsq?= =?utf-8?q?sUD4ieBcD0zUOgx/Yux24FxO1PkwpObhzahpoDbTbOlHtGCR+wkkO+PAJX9EBBLk8?= =?utf-8?q?pQZCVqke4TQxcGYdzbjznHMDpfP9kFF7vF+v2wTrHeeEoZIeK6vb30F4z966gWXka?= =?utf-8?q?/0muV0hSVfryo97Q4nVnxdwaCJPsq0dta11Ib0tE6WnYq8q2yNAnRb+4Y1h3lmGQj?= =?utf-8?q?3ozOvnwdP+6NAfq1Kmpwmk2H0yZ/krTrNsU0IVyZLRe02c0TZ7iKwIkmJH8Mozcci?= =?utf-8?q?T92hVYqVaQ29gxAF5MvjNxzlJifUH8TXuKh3Z08NWXvpbDKHEztxwLUJkZWa51Ly7?= =?utf-8?q?pkqQmJVQom9xOCd9NtTVtK0ArsYMphp3wiTFyBUQ6BOWMfKqIUivf9kdwdQYp1nT8?= =?utf-8?q?CpVi8hup+8AaodcPAjzZc1zCDRJTUuNKdhi6yqwntRlD63DdRpWopjLHs6DZ5LRzT?= =?utf-8?q?FEmxI08j0T63NtKa0FU3zGRF1or8CTbugGXzPQPFvb8CiRBaew7VARFAfBLRd/npV?= =?utf-8?q?6wzXjS9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?q?XWeOlrrSOcjX?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a58bc258-71c9-40e7-3d3b-08dc6c3bf1bc 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:13:09.5321 (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: J1GjQsq3v29c4m3/YXAs6Ektsn5bDk3jJgwDKomPp3mvw04yndm2r8RYRPJ3nySNDMLJSkoCImINANayGJ8DNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8174 From: Peng Fan Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan Reviewed-by: Patrice Chotard --- drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index 978ccdbaf3d3..a8673739871d 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -670,7 +670,6 @@ static int stm32_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node *np_config, struct pinctrl_map **map, unsigned *num_maps) { - struct device_node *np; unsigned reserved_maps; int ret; @@ -678,12 +677,11 @@ static int stm32_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, *num_maps = 0; reserved_maps = 0; - for_each_child_of_node(np_config, np) { + for_each_child_of_node_scoped(np_config, np) { ret = stm32_pctrl_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; } }