From patchwork Wed May 1 12:56:10 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: 13650644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CCECC4345F for ; Wed, 1 May 2024 12:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TrDhE7vI4M8mrF8/4gF4PW86Koykd5/UBO2beL40Q2I=; b=wAo0MCw9q7MeK3b84W66Rki9+X w8pokEefzG9VuStCm0b7qQjVFuIyRnHKve42sia3sa8IsfHlCkgdr9+ueJt6lXURIm/VRj9Kf8eDQ qECZxPlYmyWgNkuWKXQCKBKVYYrH1Oq6jLgGIAwIouCgve6yaReetF0c5x2Va+3q4ZbrF/zEa9qWW ARm9JvtGy8DFuIc+kipAJe09mlaUuTt47YZlL5WP4+5cArwl0fOu4SqxliSZ7PLhZmf4Oe56cXkhZ vx2fPWA0giR9NMcB7uAtRaY/HSwfuYWbR8+bcQzd0VlvI6m3uiFYuphjvnhwRujhppfAxf/3lt9YV x2yVCBGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29R5-00000009ZuG-3P2z; Wed, 01 May 2024 12:51:47 +0000 Received: from mail-he1eur01on062b.outbound.protection.outlook.com ([2a01:111:f400:fe1e::62b] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29Qy-00000009Zmx-0IfQ; Wed, 01 May 2024 12:51:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cs/uFvgGf7J0mxLLz5tqMXVQpRAbjNRnrtuTQbZ6xFVpU64vWpZmo9HpwTXQCzYWa/HJKKrOe/eZ2LXvaD7BQpwtS35p6j+C3nHQPmpFkavYuPe49nGT/vYZ2PxuzKckhkgcKJnRALoAjs14PBQRXfw+wpWZz1F4HOV4K08oUgwQ/nQccuyhLsOj6sfUNh6EVzaI1MDoF1P6KFSUv/bRlm4BDMunzwy6a4Pql8aH6MubiYkRDyqTECMdJioasGac5S7OO1nGI8smTtubeZWu4hx2Zxo2YASvo6F6WclWhhg3cwrCbVzrRoQGVW9wE67+o8LcZUIVErxfehoC9pUrqg== 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=rPCG6xZzK0LC/23B+oYJdueIO/buCemfRXEoPX5rvQQ=; b=WSKsscBH/bb9MG7MVyy1EWwJadP4dUF9oRYqYVXqP1NvUQsivx7VTQum9bh5dZ1NPmqaQG5/UfgSqVfRvrJueC8jNckZedJ1B+rZQpUffq1JZhB1WUBok9v8viacjarKybJZiRKExS+Yzt/Vp32cvtPmypPWQLhA5JZxl8GalrEcvOe5hGtHiBMHhKTSVdtEYl+kRVC2e6NYt+lwMHyL/rxSA4PqvweVB6KjTvSpA84uaJJ5P1qPQ2bWuGG5fN23/NzqDDeEnIqz9D15lbHAzBkPSlQt8kduLqW6gOjdKeXK/y3LXF++LsxW8385Xamq3bygfFL8grCzsdU1a1yDTg== 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=rPCG6xZzK0LC/23B+oYJdueIO/buCemfRXEoPX5rvQQ=; b=J0l5AzVhTQLI1cvCJWqrnkayUw54jIhbmT/JLizp4vhOXVmPOPL2GaBkwanqaOQ4Tt6Tsd1mFCnsi7lXcugBlt5Nz7/1ZDX/ubywgnJK+CL5/gUTdJYp8HKgg2ITuUUTWXWHuSDdhClCPMs4JiahxWDFOva3o+Asr5VsZyprN7g= 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 DBAPR04MB7448.eurprd04.prod.outlook.com (2603:10a6:10:1a6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.38; Wed, 1 May 2024 12:51:36 +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.7519.031; Wed, 1 May 2024 12:51:36 +0000 From: "Peng Fan (OSS)" Date: Wed, 01 May 2024 20:56:10 +0800 Subject: [PATCH 12/21] pinctrl: k210: Use scope based of_node_put() cleanups Message-Id: <20240501-pinctrl-cleanup-v1-12-797ceca46e5c@nxp.com> References: <20240501-pinctrl-cleanup-v1-0-797ceca46e5c@nxp.com> In-Reply-To: <20240501-pinctrl-cleanup-v1-0-797ceca46e5c@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 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=1714568179; l=1076; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=58KovdEVBZIsn2lfhZ/T0dqiN9oElq31ckJF6Ac0RQ8=; b=c3FRzwq+30RvCffuhcmIdUhGjJH58EpOfxv532cKlTQz1SNPixnIM2vMx7FK/oFWna1WvxNc8 KHSDWPwcDuiBDzI/9ofA9cO0ZgozcaCukmcjlONWBqylIbTo8zfaTkV X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0064.apcprd02.prod.outlook.com (2603:1096:4:54::28) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBAPR04MB7448:EE_ X-MS-Office365-Filtering-Correlation-Id: d5210ffb-76d0-40b7-74e1-08dc69dd6fa8 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|1800799015|376005|7416005|52116005|366007|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?fl6DPASH9Sfbq+97Iu+lL+4xuDpJa+1?= =?utf-8?q?FoOnJzh3SkiuJ13CKwlWk3w0K3/+ZFh7o/POfAw7OOlW/xKCs2ICDw4STwyK5d7z7?= =?utf-8?q?C2Qw8S5MsAA613sE8OxoAj9chTk0G1eovSfLGg7B2aHNAKsUTrdLxE0LZjeI4vW7v?= =?utf-8?q?FQ7jI7dx0ouD+mTZZ2YaJwiNoMGyVJDZ/ovb7Ups7Lu67A63LiVOHsPMg5w2UVzE+?= =?utf-8?q?UTJjQs1hwvhyvcMGPN8Yl8dGyMwbwBC+ae4OO66G4Qcf1d7ocnz3lshkdrZQa19S0?= =?utf-8?q?t/xfX8+pgUrTzVz9qQMzZHA+sWoQTVyPXybpHIPHknYBDi4epguB9c1X9StCjZNmA?= =?utf-8?q?+wbZ8RBbOWdEb4nwCum76dkoP6UUaKGaUvQkxMRFIGUqub5NTL1nuUhdkHno+B1Xb?= =?utf-8?q?95wqXqGSq3Z28Ovm+/HQCvKE1gkCUsANWq3WmuflJJmzM1ShWR0Ao1davPwi7sLRB?= =?utf-8?q?Q0ZLdrQPIc5ObKzrcXHtBwmCUDKBHm0qwB9jBi1fr69tTK0jho44HhsWNtbLvAmhb?= =?utf-8?q?3HJXgLknU+Kk1hpdQNrC6WYt0TmwUd+AQ8cGC8xRWwhMBjMwPHeTHQCuh1TOS7oW0?= =?utf-8?q?dqHCyH6ijgnKJl9lkfvGtijxaa0JAi1qzyD0oLrBfsiyiYzxlaiKrgKMMllH3ZgJB?= =?utf-8?q?1NvvkputlbzggsqrBZkrw20AJscooScyoBNWVcYOVTdJ26UR6ujRN4rt//Z5zqKDn?= =?utf-8?q?g1R9A6f8xi7a5lyj8XKBn9ZHM22qZ5Zr/S9HBv/QeJXKGIJ1QG/03sk1HmuvW3kwW?= =?utf-8?q?y42oVveMdlpD9fo0k7Z+f4chdDSizUSFLFWY0selCAO4AG/qycQ4Vz7bDbi5JfW6O?= =?utf-8?q?fOzfsrHHqBVqZNJJMmvp4IvKC/XJd2QL9Adg6VvsQOYD6ndaN8Rn+uAWkSqkgCY7S?= =?utf-8?q?RzEMwlmwGmPiKPhC4058qnbcbe5mgahEONXUteQ8g+2Xm7dw+kc4yiDfDr8S5XUzI?= =?utf-8?q?05MCsoY2zlVEhHYbfeVHX5nuJLvp435akNPNzgXG/DcY3xu/nf2vfaWrzk62J6fcV?= =?utf-8?q?l7DbkdpvYLqTu6IAJuoe4M/8m62y97jnFWJxgVShj9jtnGNNG/pdDget5MIgUj0iL?= =?utf-8?q?8F0QPHASCoYvtLmoXkY4nrexmzSYz34VgC4uqQcwZlB11parI8r3gtUW0r13L2Z6h?= =?utf-8?q?t5UA99OmKKo1eo6+7X/vgt/pie563cX1+2eCVf6Id/CiB3lDpzly3vberCAOcC+G5?= =?utf-8?q?2967KR1p93Gjm0SIzVL1+CQbGRRnWs8KV+eNuv1BcYjazxRc+V65d1eVSIAaob39y?= =?utf-8?q?wKp6q60CJlAwtGHf0aLUAGIaD+KESmNUJPrYiZNFLjcUgInFZS7LcCt4=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)(1800799015)(376005)(7416005)(52116005)(366007)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?oVM1bAFOkmQV0kr7LQXJTZZ7W8Tc?= =?utf-8?q?guUTtRoBwqZC1YksO+fX+WWHoyqafja/e6DdPk0rYmY80O4feMY5tpTIOKXiqrBeX?= =?utf-8?q?RHQGdelx2t2kLp1kMC0FnZ4sKXbeWzoac508Qi0ehTCxKQ8aQc08HGrv/d0MxUnK4?= =?utf-8?q?JAglYcqA5yey2/rKQ5CZAvgX5g8acLET534n/6YiKXU/swddedqfAGAlFCSQkXXuE?= =?utf-8?q?KMtJ6D50+fNKNfSecrQ4ZlrsQ4T2FnMk7+oJgNS4DIGVKKeH7BroN/oeRaQV5PdRI?= =?utf-8?q?AHaA8BHt4cIafjqV/L3oJ54zcAkD+ZvpDMvIa7GeUTzYFEwS+b/mlPWPI+MzWE/Ti?= =?utf-8?q?25JMh28lJ1mdq2D9m46YoiPSJEiat6yNTMHpBvQb0CbXCNEozza/OY+pxJwFL0US9?= =?utf-8?q?wWdJjHnrfuBcD+cpQqUTLFASPWLECN10O5KANqr+/rr/Sp/1pIOIqhN4nQTXXUA4C?= =?utf-8?q?qmRVsm0mAELs2RBNNFKpjaajjz3UBfxz8yt3FhXiGtXRuYJ0rzv2ozCswwxwU3vRH?= =?utf-8?q?ipqixkWBiienVzZaBetrlKyR7rOh5yNaZclWAMpxF3HgM2+H7p8GstBiqBQJLpsB/?= =?utf-8?q?M34j8WC65CFAIgrjAhTbNrXrFaiZ49bkozS3QxxH47/YcyfRrsB0q5MGyFGZ5xnfm?= =?utf-8?q?W+ry25bJchOz0lX0WDBUMlIN4QZtY8WE7oVs/iFXoPQ2Op1PwQ1rVmIPUULbdK6s+?= =?utf-8?q?qdgqjvQe/nxzhlclzMPMJptsf7jRUTf9w47yvg13K7uOzAEgq4B84AyLNXpBuIsae?= =?utf-8?q?rVqN23vQCF5d7hDCQUHyDRzhHtGGmGebHUxVszodZl1uEI7QbiIhR3nkuqjgLuJXG?= =?utf-8?q?k4AZ2Bqv1eO5MEyELeFj71XPjPu00GDN2MNauCCsIvdCYdnueJhpEzpDAZ9xufUEx?= =?utf-8?q?xL8VC4jHPJEt/XCXj2+KoiiO1kPoxSEO5xZCuUsjEd57zra4zspbYvi9HaiKiLuyG?= =?utf-8?q?WqjkQKdRp2Gvg+B21P1Q5QrrbyzUcO5kMziRowGazqszT0SksOh/EDUnxnkxtvNWH?= =?utf-8?q?ogIlurdXev8ZtD5rrmP0Y5u/21uOh+lnrK5p9Y0sYSVGOutrQ1lQfZpyJHrhxBlqC?= =?utf-8?q?zulphSvN2jg0YUDgPN2JtdStaeHmDecbZFsFgAriHjXkqdsIof0ZdrGIaxo+UquGv?= =?utf-8?q?XPw2Flc2yvLqcnN1yBzQ9b7EpFT03G9PqR9nWWjPYIMpZY/Ub6MQKyCkEme+9tfsZ?= =?utf-8?q?nMsU4wo3Bzb+RPxKm+8aUCHx5uZcODvbCv0dPavEbyVAijfQG/FH7yFixmzo32NsG?= =?utf-8?q?RLbDOsiTVvDsX2U+FcMD1Nq9pVW7Yl3ZPRRPiNcHdmzOzLjUrMSyfw22egLCIP0od?= =?utf-8?q?ffiC+mTPKr2TDZfDiYiKmYD4q2TQ0ji5X/uUfER6Adue9KzPsqCU5+Z0Lfy5HgFxB?= =?utf-8?q?HI0VIIAThgTalWSbStSCgkU/i7X2rzKqmRMuXLE5C12+2w8Un6K8WALpzkSTtH4/o?= =?utf-8?q?eoe1ZVDLOy8DlcJL8hW5fyIh7M/NVCMzAO7NANtkDawtQs6MmrDBtV8apihdZdr3p?= =?utf-8?q?/8dXq1YpFEw/?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5210ffb-76d0-40b7-74e1-08dc69dd6fa8 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2024 12:51:36.2712 (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: eq+udYVAMS1P7iBaC80ablFAPMktGWwiy9wgk9o7vE0CghgI0jjxJABORL/I2/8dOizP02pL50uDDaV5/5qH4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7448 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_055140_330875_81476803 X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Peng Fan Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan --- drivers/pinctrl/pinctrl-k210.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c index b6d1ed9ec9a3..2753e14c3e38 100644 --- a/drivers/pinctrl/pinctrl-k210.c +++ b/drivers/pinctrl/pinctrl-k210.c @@ -849,7 +849,6 @@ static int k210_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; @@ -861,13 +860,11 @@ static int k210_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, if (ret < 0) goto err; - for_each_available_child_of_node(np_config, np) { + for_each_available_child_of_node_scoped(np_config, np) { ret = k210_pinctrl_dt_subnode_to_map(pctldev, np, map, &reserved_maps, num_maps); - if (ret < 0) { - of_node_put(np); + if (ret < 0) goto err; - } } return 0;