From patchwork Wed May 1 12:56:18 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: 13650669 X-Patchwork-Delegate: geert@linux-m68k.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2082.outbound.protection.outlook.com [40.107.8.82]) (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 76FFD12BEAB; Wed, 1 May 2024 12:53:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.8.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714568030; cv=fail; b=p2GzLWLvo5oCwI/hg+F1TXN2EaQDWH1uZii22Himd9Lz9qG+iWsQD3e9V9qkv6OAurGKUbcGsCgNpRvrxMw00A06XvPRQ24w+0cNUQqm8g9f0Gw8SBoBrc5c/gZtx2Y6Kk1AWe70SD9qotOA8uhhQilvqUfmr0RSbur3mrh9rbI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714568030; c=relaxed/simple; bh=bSa1Qkf14OuNaO5RzY4Gu3WlPihsAEm1/Tvc41VbvDI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=q/YJMqRQtiEH8nON6vYqvUxMwhTBSsdlbA6QRtiXX/LeCh2GkEMa0+aVngkq3H30mZ48Hcae+rxyciUQ07ewgWhdBeOm7kSg72+Thlgzv7jYO46W/juj+2ovjaoU8WufIUhZGV3iD5jmxBFuLUMO/wz3rB5q01m6IAUClANEtak= 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=K2kLC9l5; arc=fail smtp.client-ip=40.107.8.82 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="K2kLC9l5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BrKJRJhrAXXi4i/+hJ1j9UdpHP6FNcrQn0czFC9LXFQmQ1uSkEB7GR3LWWmZMgGTG9LkBvN7vksBwqUi1t/QTes918QjXcjCE/6cRCeAYzaTCZSxDkNRcGzUuD/qXqqFXP9hr5uxDO2qZS7mZ7mx0v94SZjtryETWDNSr2AG42069jK+x8HFnhgd8U7osV0ZGPdeTUeHxj78Z8DavGulcyaYMngCb4BcJ23r1+dR5pkUa9DPphAqku6QxRiBqQTuqrkPzawnpi9lUuPtqvv7mRQKnHrAaJqwkrWExgVJxUBAWpPnvHfFRoV2I3W3u5DC7Kr97vXliWw/mc/CuVcLlQ== 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=R/HN0uRuWCWJNe64LQrS5DariOLht/eVTftGm18bK78=; b=l6RwEFZACPoVhJluOHFVBI7404cwKjbhdcTkQfV7s+pXF2DvE0zDcVrPbV7STu+icsFCwieWq7YY3327y8n5uESrBn11x6r0r0eA2C2fHn+x8leJHCLWWhQnWcsrS9U+nMBoW/7mrxO3PKu7NCngvfa9KjLorlxmgzeU/qckET+J+VjrtjxWY5+H1Mq7nUNfAMuNmIC5/HQ0Hm4MV3EKcIMZ/KxG5ie2JD1eJexyLfNFp4kpqO4yzY1Zunvv8rkG9MRXONWdLaZleOENz4H7qKalMYyuIdf1r/hVjxWOrt0qdc5pZdjZxgFE5rhzrsb5NavX5aozKi3DI7qmjB2wtQ== 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=R/HN0uRuWCWJNe64LQrS5DariOLht/eVTftGm18bK78=; b=K2kLC9l5lAUrG/78F6bbfqzg4obvd9TrGhg4Nx1bTHYElLOBWA7zy41Lor9jbtQ6E3G83iXxQ8YpoojMX3umsHMeZ4p9PVVKqDUCurBTX9NXcLIdMk1nwHUcnl5rhDhNsuSs4WQQh1lDQSshFtTxAlIzsBmTJfu0u9Vt4XXiMVs= 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 DBAPR04MB7432.eurprd04.prod.outlook.com (2603:10a6:10:1a9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.28; Wed, 1 May 2024 12:53:45 +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:53:45 +0000 From: "Peng Fan (OSS)" Date: Wed, 01 May 2024 20:56:18 +0800 Subject: [PATCH 20/21] pinctrl: aspeed: g5: Use scope based of_node_put() cleanups Message-Id: <20240501-pinctrl-cleanup-v1-20-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=1515; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=h0a9LV3oYSEF4ccWiOP3By2vye9Q4bNslLUZUu2GcUk=; b=SXVAnIHFcdSsBSSywnFDOPtR6P41Bx05UTk5YENmkF0qjYhIsrg7zH8yQPwm7asnMsPxjxU9Q 2b97znrgTqNAgUnmN2vMF5Tp2B1upQ99/QV5V2XBdTEDCoOEv2AncJh 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) Precedence: bulk X-Mailing-List: linux-renesas-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_|DBAPR04MB7432:EE_ X-MS-Office365-Filtering-Correlation-Id: 2309f409-67c7-41f7-b48a-08dc69ddbc82 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|366007|1800799015|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?+hqAZ0HoGwY/WdrbOpLQQ/oh5PvnSmt?= =?utf-8?q?rEKQm66X0rS7ZC/1nbs/FzXHn5u13O4WzJ9ivk2AY7uRGgueBBgs1Frlhl1WinUko?= =?utf-8?q?IXxOxq4ygR7uoBq8T42toBJ/chQK3UIt6WMYsKRtqgU8PY9sijwnap5T+EEPATDEb?= =?utf-8?q?kTGH2piaYiLN93AVJ64bfJ/nBaYpXlLS160B38Hy4Cc/1zxcQpkk5zv4ZuibqUWph?= =?utf-8?q?2rdnS+A5A2UnV9b4rUQ7IWMpKZhpqpFPXkpRUtsBlmWPqjxiB0ipzlF42joFB38kA?= =?utf-8?q?bv/SZava50TUAUQ2IV0Xlw8UpvS+c7OKERh4rIWj3R0X4Rkci96ImaxndGfNvQ0y+?= =?utf-8?q?61I5rsTv8FFAvQRY+WgbjvUFoMzeC2yU3YPEJuENgyOHRXNnPGTllgZVOBpGCfXP6?= =?utf-8?q?DkUyy0cm1iASp507706nk5kOPHgvvGo9UVuZUuDo842DdfhjBLqKK6nZ7RUs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Ps=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)(366007)(1800799015)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?t0703+/aWSCO/2wCrXB0fYRVZgkt?= =?utf-8?q?By5CMHHy21zvE12ywNeGWizZeKtM/FY0/XFn9ki1FRDhNS7NVyCkqCLw9uYs/AeA4?= =?utf-8?q?MQEPuzNbUgjxM0X6TPKu2azih9RVWipRRecN7arOe5dnvqsFLqAvQbf8K/9rvkCjq?= =?utf-8?q?frc7DMppagi7rdYP+vNfDwvXqZlDv8/tqio26UYelRxCac3ngrSSRbEtsyE4iScm9?= =?utf-8?q?KFlxCzcOYScQBZaI2UkjXDL8zNQ9oOM7n6Nb+/xYqJpUxu0XL8SBUoKupglY5JFXJ?= =?utf-8?q?C0A5mUWg4fcSonrhJly/af/YK+MLIHwf/2tKMyEOQZmYUklsInBJEPEsBo0XxDQx9?= =?utf-8?q?7MIgpcw/HYv26z36SaVDXzEsS8eDQUvdW+2utnXxgWLPuSdQ5zBTXOcAmyA6YL+Ku?= =?utf-8?q?5wAd1GDE8vWfLADf9c/9A573uq+SGkNMtZg2ot59gObHrcs217w63Wo+dgafKfBP/?= =?utf-8?q?fnXntwr8MFBoF0z3ZI+IGnY2A6diufWm+q4CMnIOUoHitTQPh5fBqDDVnqqzU12J/?= =?utf-8?q?TwORVG8cFnvDdXusnmxdfppkXD5Wn8UieOJcUVYOOgLidzcAhZ0kGWvTPuJflk/lv?= =?utf-8?q?GEXMIbd+NC5O2HHPepf2MuByLc2q2ZnXGs1EW+58/w/WSi5WwCkpGYzL2DtWE+/K0?= =?utf-8?q?4QJOyeDdm2tEmH/bcvbbadVKMwIbJDf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xp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2309f409-67c7-41f7-b48a-08dc69ddbc82 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:53:45.2588 (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: c7Hq6vl1hoEdKBQfGyXFYIZ+fqMoLhYMh1DhSQi9POJ/KCDU7AREbfyGyyrtUObiPRdCGCkfUxBwOXpIskS6rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7432 From: Peng Fan Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan --- drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c index 5bb8fd0d1e41..61fbfddb5938 100644 --- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c @@ -2629,14 +2629,13 @@ static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx, return ctx->maps[ip]; if (ip == ASPEED_IP_GFX) { - struct device_node *node; + struct device_node *node __free(device_node) = NULL; struct regmap *map; node = of_parse_phandle(ctx->dev->of_node, "aspeed,external-nodes", 0); if (node) { map = syscon_node_to_regmap(node); - of_node_put(node); if (IS_ERR(map)) return map; } else @@ -2648,7 +2647,7 @@ static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx, } if (ip == ASPEED_IP_LPC) { - struct device_node *np; + struct device_node *np __free(device_node) = NULL; struct regmap *map; np = of_parse_phandle(ctx->dev->of_node, @@ -2660,7 +2659,6 @@ static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx, return ERR_PTR(-ENODEV); map = syscon_node_to_regmap(np->parent); - of_node_put(np); if (IS_ERR(map)) return map; } else