From patchwork Tue Aug 27 09:57:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13779149 X-Patchwork-Delegate: geert@linux-m68k.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2071.outbound.protection.outlook.com [40.107.117.71]) (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 B4A9119D89E; Tue, 27 Aug 2024 09:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724751755; cv=fail; b=h27dpuBPxS/RSCbty5EF56XIHxMKEg/IdaiLCDlJ/U3rhcIppvRUXe2enNJL+JdzaZnd169AW+JU5HI99qY9ZNxprwzMqVuPgxFFi0XpUOZg10VMUGKVYvDVr6QPNN+evMBK9weKHLGZ1FEzYxYIzwhbak3oW2izfqJaQ8h3S/s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724751755; c=relaxed/simple; bh=N/tUcxjy1xJBFZ5NzpV/baThbpne8L5gs9MZqUQ50go=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HULK5SwXsM2qXlOvAfK4/GdQRSQEUWWCqPulChgyi04To/Vz7oykCLV8KlnK2VAd9Yk49aWbF42GpFIHaWbX41xGIh5xRh6EkvFiL+U1Ew43egVGMtm/6agVyqZePxcEgzQd9rtuG+QS4TFXVAN0vJBys/uTdMIA7meybH8yp1w= 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=g7ZJDE/9; arc=fail smtp.client-ip=40.107.117.71 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="g7ZJDE/9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f+oeliw8+G9yywAze9XcLIdcxfBOp0OsRp8ITmvDrRx+RJf1+xOU0lIOq1pRwLXRGTcVo6IL73lw80js7M3TAQZ/uaRljYKeSO7JRE1h8j8Y6iRRCLgH6O+a0EsO2F9myIURo6MkF2/800jqdpMuiLZfOTLC0ZesV4yHVZiYI+Oc3JC//INjWcUREgnRGRxfdHXceVjlw78BzQvXaCf/0UI37ybofdjPgtP4QO9qe/UcHzFupNZrz87o3Ky7JaUV3UYPIR1/QgM6zP+2e3gJh+tum9A+lHBBq/+AndacEiTaIXFJUELRBZ/66hjWYz5hE3dXFW96H4nL+WCcKBfN/g== 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=0wKdpf+etVGbdks0u7PTUFK7xQGU2Gc9tVtz4VzV9uM=; b=O622IQkWOaa5m2geVDW9EfDkth1lb8iPrduA3Oef1BVSUDRrvnR/QRkjPmPRdvuecVFmXvBrhOVkNLYCnFnAzbDWWJrufxumthYP6F9Qt3231Ni9DLK2tdvasLN+09yRkO3h7N//jViwD+eMgC7cx5bhmpKRQX2tX5bFAJE+1DrFehf/8cISftG9wDOfPt3M/7GZCSuPsIOlaiteC3v6xB67cOpqoER/UgMmRB3tyrt3zcw45qnIWumtHhdc7+aPkeoR7TDccdZcELg2SEDOqjp2LIendWotiIbeWT5TDs2tu/LYDM2sCplvcwmDSXdzTVsmdElIjSghKwRJSXQh7w== 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=0wKdpf+etVGbdks0u7PTUFK7xQGU2Gc9tVtz4VzV9uM=; b=g7ZJDE/9EKlh4xggzQy+tsrlwTrhiJastyj5TLM+cefMdeXtOXZHxMZhLju2mIVla3Wg3dyVfmQtE1Q+BjZtQnPCpd5DDMKlQ80hLgngkxaXSs7pt4XodSk2eZoROqsJyqgWqqQ6iKhz/aG4JB+rAfPM9qDkcJYVr/ANf75bUYWIPPuiD5cgQpOfdLkREMoj1EzDdqFhvx9edOe2pBP26TeFQ06HpZlPNoYORHJKWbiYKwN6RgoTgymRIOylK/8znerP7GhZqY/qCWqW5GGd6cIiJn3MUPTDw77g7IQQCO9OFRnS6bX/ljpRg3EY0rWz0yS6U7Y7TE/EEF9oOq/twA== 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 TYZPR06MB5734.apcprd06.prod.outlook.com (2603:1096:400:281::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug 2024 09:42: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.7897.021; Tue, 27 Aug 2024 09:42: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, u.kleine-koenig@pengutronix.de, jacob.e.keller@intel.com, justinstitt@google.com, sd@queasysnail.net, horms@kernel.org 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 v3 4/9] net: mdio: hisi-femac: Convert to devm_clk_get_enabled() Date: Tue, 27 Aug 2024 03:57:07 -0600 Message-Id: <20240827095712.2672820-5-frank.li@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240827095712.2672820-1-frank.li@vivo.com> References: <20240827095712.2672820-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0053.apcprd02.prod.outlook.com (2603:1096:4:196::16) 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_|TYZPR06MB5734:EE_ X-MS-Office365-Filtering-Correlation-Id: ca0568ab-969f-4fc8-c8b6-08dcc67c9178 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|7416014|38350700014|921020; X-Microsoft-Antispam-Message-Info: wzRWpStLmM//68hSCDOZKPmsrInvem8e6hIAK7wAn0SmHnvQt1tMTr+2ouw7w0pf9zapxbessT8mXG9WYXJDZR7NJKr/epHUuYpt+Xie5PrHxlxdJamRCc5a/+iS/tvSNd5UlpUEgux+RB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Zni4dYngqbd6eqvL/JW9s6u1VfuHRfqJ9HUp/luNRSgBwQhfpErvr3agZSlkyKjswy5IZ/K6IyoujTD8pVNgj249AEG/bupCod3YGGjOD+9odaC5OSErztgFdfiY+xIvxPWm2ZL+6RecqvCx6N5SSA1U1ZJM8CgE9Uz7jCOTteUukK9qrAEdsBvAp4+n9N5xoS04NJlY4NpMjfTrqNh0pyd3ulfY3vdOSjiiMhZpJLtuNnI= 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)(1800799024)(376014)(52116014)(366016)(7416014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RV7vC6H6p305EUqC0c4ZENuoq1oAmZxrWeGtX2C7aljn3rgpzLt3ouRC2X59VeIi1dvmU6UZWOjQGL2cz2ZZWgAtsWtQx9uF2WEjlBy+/AQ+K4UANFsXC1t1IXp5rJxQiU09bK1tEh5O95jbf0x+X/hBV+bqa0o+Fh9uzwJlRQNHn1HZX9xlqj73qBPobJmf4k4bmbOSB6Yx5xQ8IB8lkoAtlIRlkzFvXvV1YunCEDJA7fZMjCCC9CcF5JP4Vom39pkbQfgxQjUWt5U+6FdvPon0wclheIvycxc9zCu9m49n80cVpLtwk2sm5Z9Cgge7MqwmDgA+eiLgW+YnJFUn6Bssv8gACEkxpMLHbjYA9mzfuSQKnYYMgmoIKoRXrD5sVFW5VyENNcfdkBXk/eazJf0/CWgKhoNDMQ4YpfzXZuklIOm0Y7J6xXMhoScMM5O5dGc4df89xtA9urY4usNGkILufQh4FbnI3ju18OnzfSOKfA3sur/wn6knmZYaFItX4rTMUN+uyz8JbPUv9zcZXDCGr5Td+ZzFtzFhJXmuJVFNZyj9ro6ZWPiDmoFpm+3NCfzRko+ltTN+KNrxTZvzl7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c9178 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 09:42:30.0468 (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: Duv1ydduBHSZWwGkp/5QzInskBhUFVjwdRR1tEc9kZbi9HpXUkggE5/9sg/LFqw0GAYBd88W5+PHpjpdrLGEsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5734 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/mdio/mdio-hisi-femac.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/net/mdio/mdio-hisi-femac.c b/drivers/net/mdio/mdio-hisi-femac.c index 6703f626ee83..f6fcb9e11624 100644 --- a/drivers/net/mdio/mdio-hisi-femac.c +++ b/drivers/net/mdio/mdio-hisi-femac.c @@ -21,7 +21,6 @@ #define BIT_WR_DATA_OFFSET 16 struct hisi_femac_mdio_data { - struct clk *clk; void __iomem *membase; }; @@ -74,6 +73,7 @@ static int hisi_femac_mdio_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct mii_bus *bus; struct hisi_femac_mdio_data *data; + struct clk *clk; int ret; bus = mdiobus_alloc_size(sizeof(*data)); @@ -93,26 +93,20 @@ static int hisi_femac_mdio_probe(struct platform_device *pdev) goto err_out_free_mdiobus; } - data->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(data->clk)) { - ret = PTR_ERR(data->clk); + clk = devm_clk_get_prepared(&pdev->dev, NULL); + if (IS_ERR(clk)) { + ret = PTR_ERR(clk); goto err_out_free_mdiobus; } - ret = clk_prepare_enable(data->clk); - if (ret) - goto err_out_free_mdiobus; - ret = of_mdiobus_register(bus, np); if (ret) - goto err_out_disable_clk; + goto err_out_free_mdiobus; platform_set_drvdata(pdev, bus); return 0; -err_out_disable_clk: - clk_disable_unprepare(data->clk); err_out_free_mdiobus: mdiobus_free(bus); return ret; @@ -121,10 +115,8 @@ static int hisi_femac_mdio_probe(struct platform_device *pdev) static void hisi_femac_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); - struct hisi_femac_mdio_data *data = bus->priv; mdiobus_unregister(bus); - clk_disable_unprepare(data->clk); mdiobus_free(bus); }