From patchwork Fri Aug 23 07:21:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13774672 X-Patchwork-Delegate: geert@linux-m68k.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2057.outbound.protection.outlook.com [40.107.215.57]) (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 E6D70149C59; Fri, 23 Aug 2024 07:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724396838; cv=fail; b=KApzhMDbNB4L5nIsbP2FZDQdhcDY80FyBOxRY8xXim0f8e41yLFh5Dk2At/If+W6H+Q7cTDbAU/rHnMC/2eaWAkV9VzIbgQlk8pyDAQjOClQ++3O+KlgnNf6IY+trN3O21N23AtXWFMxA7JKJxV/kSocSAMbAekYCruWgZ5fKbw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724396838; c=relaxed/simple; bh=zeX/YnL+vXc3rtOcLL7mYLbRFsPSV5CJbQZUVBOm3VM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=X4iJ70Qkv6T06QsvqSD5w20tY0Q3tsQkkeo0UuD8YnNBhQoWsheOjuLdnZ7Rx8IF3RevzAo+2n0VWHI0m34QBv2e3t3Dfno0VCMMg3+ydL9P5eSOpidhfHFj/nMMCpK8BvSQHgYI0uUBSDW6yTR+O1XOM9IumOHewqFUwPaDhsE= 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=jqha4XvR; arc=fail smtp.client-ip=40.107.215.57 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="jqha4XvR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q2D0KqWreQIbSwRFo19ORgXIfe0tYN0EVDkllfD0XJb8m8OjUsAeaPR9WHgTJck3Kftmtti9edg41bAf4Zl1fw6kIBH+ADajjSWXHtphycADvXhOEnBEdWlZZt5FTOn80CuY/ugz5ZSWbuvUuIZs03qaP9DnkELMnlhcIdt/XP2mOByu9ZgPAWmmVK/NPDKAFGvNjZ/oFwyBHwS9vCMTRJ12/vmdFuTnW7eeKnBGsdXg675EX1N8pW5pEvgtCPXieYkySv94d6HefiKoeAw5HX2+clen2zscYh1fs/mPARpqX8Vuzk55FeTbyjo8X2Bw79BahMIp5FjBw29xXK2UYw== 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=loKZ3Jg1P258pXcp3YCt+6qnQHyeqRZ5FiyqwfFFhhU=; b=olPfDqzMDeb3SOWfwuIi0UyOmY4hpleHvOKQLIRDQSc7hV3k91RyUs6glUyNIim09RxajF4TAF/MEg22VOSVWRYEErza8KkJ5BDGWBax82XtzPWw1v2N+c9p3qYElSp61YxMU2PEm/DBydBbHzFbjk3CZqyJQ2L8mppuiS6j12tR1yHuFcKewOlSjwk5G38A+s6bPMNcPI+wuRb4Hf5dU9VplQUYsqzLYZDet7s4e4zF0w7JftORq4aQkWSXblXcLZRSdsIAaYYmvUKgByR3Nh9Xc8hS+eH9uUvxODm8PmplQBIGq0TTZCkeugJUBA/YYhkulK8kBd6UD+P9M8Xplw== 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=loKZ3Jg1P258pXcp3YCt+6qnQHyeqRZ5FiyqwfFFhhU=; b=jqha4XvRQ8O9flSPaRY17jW0G/MCRVcdrDhFJJuIUm00wXgTS1OnwKnboJ2eE9rD9rLbpNVmWnMcDwvL/XCNzlUhGXlJ1U33iJIio9ttf+nXxgV0UZ1r31iZ+m7CUMmsdiO6GnHpGHptjTKURQiTgxYBGbAyN8W6Bd6E1IPHJPXirHhoJcuSUBT9dtSK5p3yYjv/TsU2udKEZWQ+8jOtCo3siL+j9OoneDXmUJb731FWnAVNqolqVr6ZjO+JSKaZkzQQHXtDDNWS2dWNNfnAuPFGMTkU9ef9XEAm/S4uZXE6k69Z1bHZN3x4RiCBXRYOgRL3dWWV2Fm/Ty8jKTwJHg== 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 JH0PR06MB6980.apcprd06.prod.outlook.com (2603:1096:990:6f::8) 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:07:13 +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:07:13 +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 Subject: [net-next v2 9/9] net: marvell: pxa168_eth: Convert to devm_clk_get_enabled() Date: Fri, 23 Aug 2024 01:21:21 -0600 Message-Id: <20240823072122.2053401-10-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_|JH0PR06MB6980:EE_ X-MS-Office365-Filtering-Correlation-Id: b5ad0c70-d0ca-46b1-0367-08dcc34236bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|366016|376014|1800799024|52116014|38350700014|921020; X-Microsoft-Antispam-Message-Info: wub3cS4t2MQTIT8vSRdjk9BRaoViw9TFYXhNPtRBdM8S81eZ9SpZhrz65iTlvy/9GKAlTKSFXjTUL6TEsrtvaO1HCBnHTp4kdp+uGEVGnG+YTs8mCZInHX6th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S7F5fgfjLngycD0MdkAE3CCveW7m1MbqRrbxwkTGOI6G6ekMEi3v6mNaTt7/rt5SYshv13HLULpvQnAlxzLhHfo8uDmfX5fG+ZkQ10m40YOghJd0fq80OojE5Ploi9SRH702UyCTP2EQRe9XN6ogOSniQ1btr1fewC3vfyOJOUiAD+qyNFrC6DmpDLXVAL6nY5LamHeqgf7rvbuK2kmXMP0yTiWD7Oyr/wHbJLDtgn1fMwX8Ui8LjoXqEg= 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)(7416014)(366016)(376014)(1800799024)(52116014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gHcQydh16iDY4IDqdEJah5Zpj64N5wIPcIocgMe7zViQ8E12YruuV//b+u5ougKo4ZVTAhG9DxVWyA8zWU7/D3x4RlMxsGVEwiEamSFYTLZ4ToAA0QpISiiedzUJu7uflTFNUezRCnOj1k1zXFsBoh3cZZc3NdT8gOHrr659oKy0Eby/IpnKiuSK2tbpkKC7zI6huMVvdC4V3gpv1AwntEryTYeWFnmumrtEdh7wrw48crrypWPQF2TxobYrFCY/kfAuzLcAzOqiFj4gq4pAAewztVFxq/r4tIIugA0fbzDoOPCzURriOFftlJB5w1JzfTtM+MAA1Jd5MhEu/5k3OT5Wqq8xKKTeXeCUt6PXqyJ0UDbBuBtBYmvq+LxtqRp+TFE7ev6B3xzGrli4WD/D+Bg3OgEyPbVo76D8SxOn2uLowp5cmN7S4IgWrrgjmQZCK81pWyNnwHGIkylicW8f6gS5vUPvZTBFzLDn3nSC5JRRWmganOm3r+4KDm2RxLu8ekafnrRdR8FxV8sVjyY2/hp6rE6LLMmiwnHZXEbvVfUkIUpum8EmEkUGuJ1eDCb/IyWWqrLZbcy/3yNrtqH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367-08dcc34236bc 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:07:13.4831 (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: 6ZXwq+EYMG0Pv2dU/Ep7T8ND5DHlI0Kzt1ugjIhensAjH/1rPrcj3deCnd4uH8iy8NlNQMvPxKP0Ou/Tubjkjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6980 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 --- drivers/net/ethernet/marvell/pxa168_eth.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c index 1a59c952aa01..bad91cc705e8 100644 --- a/drivers/net/ethernet/marvell/pxa168_eth.c +++ b/drivers/net/ethernet/marvell/pxa168_eth.c @@ -237,8 +237,6 @@ struct pxa168_eth_private { struct timer_list timeout; struct mii_bus *smi_bus; - /* clock */ - struct clk *clk; struct pxa168_eth_platform_data *pd; /* * Ethernet controller base address. @@ -1394,23 +1392,19 @@ static int pxa168_eth_probe(struct platform_device *pdev) printk(KERN_NOTICE "PXA168 10/100 Ethernet Driver\n"); - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "Fast Ethernet failed to get clock\n"); - return -ENODEV; + return PTR_ERR(clk); } - clk_prepare_enable(clk); dev = alloc_etherdev(sizeof(struct pxa168_eth_private)); - if (!dev) { - err = -ENOMEM; - goto err_clk; - } + if (!dev) + return -ENOMEM; platform_set_drvdata(pdev, dev); pep = netdev_priv(dev); pep->dev = dev; - pep->clk = clk; pep->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pep->base)) { @@ -1523,8 +1517,6 @@ static int pxa168_eth_probe(struct platform_device *pdev) mdiobus_free(pep->smi_bus); err_netdev: free_netdev(dev); -err_clk: - clk_disable_unprepare(clk); return err; } @@ -1542,7 +1534,6 @@ static void pxa168_eth_remove(struct platform_device *pdev) if (dev->phydev) phy_disconnect(dev->phydev); - clk_disable_unprepare(pep->clk); mdiobus_unregister(pep->smi_bus); mdiobus_free(pep->smi_bus); unregister_netdev(dev);