From patchwork Thu Aug 22 08:47:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13772993 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 2BF4EC3DA4A for ; Thu, 22 Aug 2024 08:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J3GiK6ODgsx/PiIlszUN8L5lGBAXPklB3EdsUplc/bk=; b=4zQurmz7fRs4Wa+5uf1WNs7Y1Q AvRsdQIgn75284SostQALLYRs4MjBe8WYhyc3r0XEpKxBo+zm+c0Kz2TqjnKG+hKuzjpSEWT5/wy/ fMNr/HY5AjN1IekMUrdEoU0Wp9o3BbpVsDLsrmd2sHHMcaXu3oRJRbChhb7MNyq3xXdnNnXSYlG3D y7zmIE1wlFZf7u3uvCKa/2YovBZmIqmq3djv3kMDg5co82JpxyXG/seCSmqZH727SWzIT5fnPzIKV NcqCBiI/zZL5FjrmxIvPBBAKvyYumnQ7WSc0exTBM058dxDydn0veJUJoTXDZUXvBpLsKFCWuL3eO Y88hItMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh3Go-0000000C4kH-0wCb; Thu, 22 Aug 2024 08:34:14 +0000 Received: from mail-eastasiaazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c400::] helo=HK2PR02CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh3FP-0000000C4Iy-0sgx for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 08:32:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yB9CtMrRKL81PFbgVcGuK7lb66u3M5ymYXWBVsAADDzOzpBnQ+iTY+IBMSyyquRes9i3pJMbTB85h0xHvR7x6Ur+abDn29C72pjzVRNIHwGfsHhPyYjr1xhij8vdlwv/mzuYKToab/k+INxP2HCNPZqzb5PB3WovdFR5C8xg32djmB82nfpMbkKB18Aq90PzX/Co7ey2Y0uEcqzIB5MQXY5vxUvOgOvIgmPXlIpYe3niW5SnPanli97KY+4YMwwWEJG2EakirdCxY6j6wavt9FaoLIB9pRo0rQYWTZQaN4cmwZ/7wKBYHyMkNXagfGFA6a1ItwU2RSOmgSTHTfC92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=J3GiK6ODgsx/PiIlszUN8L5lGBAXPklB3EdsUplc/bk=; b=JKFsqbpSSd6BYwrd0IPegrF2JoJF4rHqjYJH8VS84V8+T8nAA4mFQz/RUYTyDI+5QtrxD4MSarH0lSi7rEeB6kQepHHfwWzBcN0s6lo9qCghUnt9OUf8lEXvJFtfKvUyXWbgdyp1LEMjQWFRwNmvWQTTRt7brAWpkoIhKMLEF6cGFQ+MIJki1/N/AiXXzjUp1jPSoFkJjn28cluGYLNIt6df6wF0wP/+PrjMoGTjlbnWZn/aE7eG6wnehgs5SCkuRzGVtNdO0mteGC4M7b7ASbPvKc35cv6O3gp+d3vrSxZjoKfyBIa8ViyzATZjV+V9LQsU5RvIpzrIqoChAp1vCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J3GiK6ODgsx/PiIlszUN8L5lGBAXPklB3EdsUplc/bk=; b=RDxh+p+guYURaI3dGbpBnOkzDUkNA5veanbjGiBhnKUhp5/8m3yQOyKu2MfEbPchQVoSyWdHTHUQ7mO6o7UB1IR0yeLlq6xtFvzZTP2DohzJM7mZ0XYE/RAtEH2wHEp3zRS4aTMnsmfWuAvp0thku4WZYLSL8JzQusajipY6MXTkM63u4+JR0n523yLkMkUYPddU12zzGMQwzL6TYc0HVGnZTF+CSlx9Z8bH4ivPHtKPeoATx1W9mA40fVzDsegpwEK3p308x0LboCT3KASyTXrpGQ8eiP6ytxeWtXU7RZshQqqJzdtlLU67DEwUitypkoP3zNbBt5JwvM2ZDgyDpw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5275.apcprd06.prod.outlook.com (2603:1096:400:1f5::6) by KL1PR06MB6259.apcprd06.prod.outlook.com (2603:1096:820:d9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.25; Thu, 22 Aug 2024 08:32:44 +0000 Received: from TYZPR06MB5275.apcprd06.prod.outlook.com ([fe80::6257:d19:a671:f4f1]) by TYZPR06MB5275.apcprd06.prod.outlook.com ([fe80::6257:d19:a671:f4f1%3]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 08:32:43 +0000 From: Yangtao Li To: clement.leger@bootlin.com, andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ulli.kroll@googlemail.com, linus.walleij@linaro.org, marcin.s.wojtas@gmail.com, linux@armlinux.org.uk, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, hkallweit1@gmail.com, justinstitt@google.com, kees@kernel.org, u.kleine-koenig@pengutronix.de, jacob.e.keller@intel.com, horms@kernel.org, shannon.nelson@amd.com Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Yangtao Li Subject: [net-next 1/9] net: stmmac: dwmac-intel-plat: Convert to devm_clk_get_enabled() Date: Thu, 22 Aug 2024 02:47:25 -0600 Message-Id: <20240822084733.1599295-2-frank.li@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240822084733.1599295-1-frank.li@vivo.com> References: <20240822084733.1599295-1-frank.li@vivo.com> X-ClientProxiedBy: SGXP274CA0005.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::17) To TYZPR06MB5275.apcprd06.prod.outlook.com (2603:1096:400:1f5::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5275:EE_|KL1PR06MB6259:EE_ X-MS-Office365-Filtering-Correlation-Id: d426b2d4-df4c-4984-7803-08dcc284fe4c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: IWrC71DG0TxpHxX+7a0lHdbPIekW1PGSkw8OkqiDqmHt0tR3h/+6MsgxcvIUWU584ZKQjKs0rJ2D8jnWrJem/iT+fjCkr8OR2Inwv2h8eIfcFtBZMVKYSWMqxqDBl5E8EcDk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9xsSmJYZn0WH7P+3loZNO+VhhGzf1BlcIkiVMbnkzdvZz226rY1tHF26h5PYZXorQgnkF7WL/FBsDQGgfXvzGaPYZc+d0wXaXFVgJ/5cM7AmgsNn/3Qmy95qBhVOSO1bbRx+9/2V4keMxiRi5h1st1yJW8+8No4e7hJy20pHpKOwDepochJpFSw2cCkCSm7FEncGYO8XMJIjSqW94F9zRxalIqMZW6dN3YoM1gz3VOXdo7/5+KQryVL3NnKM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB5275.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WkNoPETHxXtaeRgYbXK3BQ86hvGret3Ep1hXG4SIkrO5I12gFBHxU7qv7pvmxTQFVOeWnNsayTigB0o6mgYc+kj2CW8sqmibAzyY6OBWPF1aLNEt5kQRoZx3bETNNGO1tgVyK5CGm9umr4e5gqgAv4J7NHdT2m6td03i4IV2IhPdeY7INN4kP+j3EOnOFKEcDA0GzbfkP3/23038/yR2llImZJiCQxdv8ikGw6ZB0eDfAQ2AJVTSpbJ7OFBtyjS0k0HH9i96aOocUYE0WsRgqdY5VTW3ruuF5TpAldzuicIXK7+zyNbeQf309ii+wJAkyPRi84JLrXHXAjJgNMk6cjuNX8NoHisZFRnup1sohOh1XMFg4HRGZ1g3vujcwqfYDA8HrLGG8nprjcFl4u4ETP0vQNXiHXf+VW6qluJ3l8mYFkg5ej1dkYoBXisJyiH2usR4pJ8omXGsDRZ3M32uU4ZdjMPiffc2+eliQvhrWAZ3m7KjjSox1/FJ4dH5OrIZQ3q9SuLP6FT0QaHG0LKXPiBYkoVUkP8bsQcbGwTSUEWnfnRf4Bg6Lo4T8PvXHASqYUQ2b1aoE0i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MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5275.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 08:32:43.9025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hJQ60OkNI8Ipnts6vRf7mzqmYTHTGM8iSlMlXxgZgl63adA0VJgMDIPcQiM6l7jEB4V3D19Q1hmou9rCXjpvAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6259 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_013247_281199_D4298D81 X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert devm_clk_get(), clk_prepare_enable() to a single call to devm_clk_get_enabled(), as this is exactly what this function does. Signed-off-by: Yangtao Li Reviewed-by: Maxime Chevallier --- .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c index d68f0c4e7835..dcbae653ab8c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c @@ -104,12 +104,10 @@ static int intel_eth_plat_probe(struct platform_device *pdev) /* Enable TX clock */ if (dwmac->data->tx_clk_en) { - dwmac->tx_clk = devm_clk_get(&pdev->dev, "tx_clk"); + dwmac->tx_clk = devm_clk_get_enabled(&pdev->dev, "tx_clk"); if (IS_ERR(dwmac->tx_clk)) return PTR_ERR(dwmac->tx_clk); - clk_prepare_enable(dwmac->tx_clk); - /* Check and configure TX clock rate */ rate = clk_get_rate(dwmac->tx_clk); if (dwmac->data->tx_clk_rate && @@ -149,20 +147,15 @@ static int intel_eth_plat_probe(struct platform_device *pdev) } ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) { - clk_disable_unprepare(dwmac->tx_clk); + if (ret) return ret; - } return 0; } static void intel_eth_plat_remove(struct platform_device *pdev) { - struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev); - stmmac_pltfr_remove(pdev); - clk_disable_unprepare(dwmac->tx_clk); } static struct platform_driver intel_eth_plat_driver = {