From patchwork Fri Aug 23 07:21:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13774664 X-Patchwork-Delegate: geert@linux-m68k.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2046.outbound.protection.outlook.com [40.107.117.46]) (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 E272813AD37; Fri, 23 Aug 2024 07:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724396794; cv=fail; b=U2N/IDLvccZjV1ELqLwCAGZw15GZHgupix8pZ80CcmVCVNOpMK2okP/RWkIzqmEvZ2ZqVDrQGPG6/kXOB2NLbPAqcKR1XgF8kK4y3qdYPTEJNrxrbKFHS+BWeVzGvCeEjir5zaWRd4LNM7tvM9rKGYX0FqUSi93pOiBEPBp1MUg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724396794; c=relaxed/simple; bh=iJ643tR7zH3ZBtTySjCVJyQlQQK4LHdROae4Wbgdk88=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=L4/FwfbhA/a//hw9VfTJ7VeuaigBOOeVDBTDdLQb+ciN3dKHe/ajc7Oj+rkt0VmMz6Xe3tECoxT99ZC4NrIa8JYA+mqFFRwpkTMNQ7xtSf1K+29OgIwUUa1fGQNEqrDQZid5Hqu/zNJKKFJHfWFHllsC95FFMopLC8xWGUrJ0z4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=Te6xy79Q; arc=fail smtp.client-ip=40.107.117.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="Te6xy79Q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JpaawdUAvEXPIgdV2Yk0/2QCee+1wpUzvAgqk1xvRKIn3kVLZYEHgE7dMAzY9BQdnv43JeCldXIqwZwjf4cD5Q0iC03m3FyXBUzpBPkZ+bA9ve/l1AhDsBZ2q/bzuwQrFWoFXJ4YbgV/YI4jQeKMSYhrX/ZktLBQaToqdCuIhH8yNR2Avavc9TncZ+4cShV9qQ+sTwZq6mi5Q76K6/W9z+O8hdjMRwZbHyHDT85U4zEU6aWjGhFaFovFehZVjIVwW5RUz3v6E5TwMI4YQEis+w/jcnrTzd6XiPuLOqU6IxdvSOtwlv0AgvueomTbB9kwA/q+eJC8AmuN0hnFzQHcDg== 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=NIMUzEZdqDpYsZCHo/7JuWKu2sl4AMxMk+gt1puAWYE=; b=gLoA0LuRsS3HN8S7Q1G6r4RsDxVt4pHXlpmFWQFwwzwu5Lz7bAPQ5l5Svn6urHw3IdyqamU7nPBUk+foeUGprwMNswGJswQuAl7rSjTjwykD1lAwOwMjxbhQoI7sEoHfS8F7c2PCDnoLobgiPvlAAd2JWvf0p7f3+OgHXJOr3EAHWij65VO2t0g2e9Zbi8bKGnCyIncHDYGbYVK1IGHnoStIUh3tsdDr2i/oNRQO2mkmsfC/ewEaCGTx/5Ppv5LNLlxQzCyK538GflyZIhplihqzp4K76vW87g/58x/TCNeC2qnGfopzLtG4cmBBesR1xM3kIaP1xsRvjFEQtFXIbw== 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=NIMUzEZdqDpYsZCHo/7JuWKu2sl4AMxMk+gt1puAWYE=; b=Te6xy79QjWxKGdvn09njIZCpHyDsTgwR1frEgkl2HKuYQnau62TroQgEhBd7xtqUxlJsT5NEdU0Rfc9caj9rCiDnGayAzZwBjDW+/9hTqU3j+bOoj/iW/o87l36pme6c5EeBih9bxeYZmGGkhUcm2ZyPysPTxmPbm6EYZKNiAy5RyDK5jKKNzS+Xid8lL4tvJsccvbqE7xb6VK7yfIVvy+W3bZz344de1oBSygMTofK/EEgFXA+60GpyuU+B3BaeDdPDT8OcfEZ7AY4a0lmJKjs7LkNZD8JlKiXzvh68FbvZJUpwm96Ce5c17o5+EcZfsQf3VGJKNuK3Zq7UAXzrAw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB7069.apcprd06.prod.outlook.com (2603:1096:101:1d6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug 2024 07:06:30 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::8c74:6703:81f7:9535]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::8c74:6703:81f7:9535%7]) with mapi id 15.20.7875.023; Fri, 23 Aug 2024 07:06:30 +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, kees@kernel.org, justinstitt@google.com, u.kleine-koenig@pengutronix.de, horms@kernel.org, sd@queasysnail.net 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 , Maxime Chevallier Subject: [net-next v2 1/9] net: stmmac: dwmac-intel-plat: Convert to devm_clk_get_enabled() Date: Fri, 23 Aug 2024 01:21:13 -0600 Message-Id: <20240823072122.2053401-2-frank.li@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823072122.2053401-1-frank.li@vivo.com> References: <20240823072122.2053401-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0001.apcprd04.prod.outlook.com (2603:1096:4:197::12) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB7069:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e2002b7-4a63-4d66-6a50-08dcc3421d1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|7416014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: YfgT8ccWrFUzAz5/l3D/B6tvian2DNvzAqOhoXbDBBBowxxEwl/DM1p/ZQ5DmTR24MyQ/3ahjZt3UpfUauxUtl2b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Gz3L9C9/B+3fomcb/dZ+VD1jArI0lBauECXNJvdTERGpnVnWG6+dHUjBD0lxenL80pgKxElnL/L9hFytCZNs4uu9iyg7VJOeiBFm6TT9T6023wqx0eY+OA+EfA+tu1YJbmQD02vMLjwJRdKRbj3tDTwDM8xEh3k9tQaQ8Kxvs1VU7ZZMjd5NbiMmtiLIL/ILzaC8fczdIF35qfwZcr9oR+1LoqaI+CxGKSGrHV4wm8TgWrz8Vfo7BB/8AyBFUAhqguOWEhgeg1920PS/BwvbA3zc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LghRyacoJW+eUJb1XtTx9vYS1qWYzuQM+hDqwXDa+k7ZGSgYQ3pCQVMgJ9Tfl5nJ69IDUY6I+RXqD5piAeIkDgvBjqqDJHwfe7Xk3fyG5r1+WR+7MAv//9KoE2IMgM2LAkTCk5xAqztSLxI6Dc6Fo5kiBGcfPMbJfpk75ZZ65GsBR84k23++4bdfFeESlSJkVWXFxvUoLKizv1oDM7nd+bv3xWPW9z8Q2OqqD/HfRRRkMZAoJ/1XUrf968MQbmMSX2OyjyQ3laEObAqjbmKfOeamFJA7xm9I0BnktkvVv1ee4S2Ce36NhQn+/Hnnxc1rl08jElNJfByKRUxKyK982F1waxETMrQOue4wXtzIo0NDJa69L0CYRz6Il1f7UY2uuafDftuG1zu+ZWSSNTF8U1Pv5II2kNzonDYgnUxIDEI4YAwzcInfcfJ8k0UUpGq3vEdxBkjRARH6Hp3dEdcWN5xBKlzYCFYzrGSv2NuTW0LgA4JfAxCd0jZnkl0UzdOIGXkjr5gdkc5mR2ousYLTwL73ua0sHzV4ES90RAxph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ossTenant-Network-Message-Id: 1e2002b7-4a63-4d66-6a50-08dcc3421d1a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 07:06:30.4865 (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: iFZwju7BaTjroZ5O9rKJwORXPK/mymwM7MZtS1MsQ1sNGxzYc8KzScyoBtTlFexN7cDTIsl2hPZd7bk1hw4eeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB7069 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 = {