lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240827074857.2671808-2-xirui.zhang@vivo.com>
Date: Tue, 27 Aug 2024 01:48:39 -0600
From: zhangxirui <xirui.zhang@...o.com>
To: Robert Richter <rric@...nel.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Jaehoon Chung <jh80.chung@...sung.com>,
	Nicolas Pitre <nico@...xnic.net>,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Taichi Sugaya <sugaya.taichi@...ionext.com>,
	Takao Orito <orito.takao@...ionext.com>,
	Michal Simek <michal.simek@....com>,
	zhangxirui <xirui.zhang@...o.com>,
	Bastien Curutchet <bastien.curutchet@...tlin.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
	linux-mmc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	imx@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 1/9] mmc: cavium-thunderx: Use devm_clk_get_enabled() helpers

Use devm_clk_get_enabled() to simplify code
and avoids the calls to clk_disable_unprepare().

Signed-off-by: zhangxirui <xirui.zhang@...o.com>
---
 drivers/mmc/host/cavium-thunderx.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
index 2e2ff984f0b3..8111e24c52b5 100644
--- a/drivers/mmc/host/cavium-thunderx.c
+++ b/drivers/mmc/host/cavium-thunderx.c
@@ -88,15 +88,12 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
 	host->reg_off = 0x2000;
 	host->reg_off_dma = 0x160;
 
-	host->clk = devm_clk_get(dev, NULL);
+	host->clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(host->clk)) {
 		ret = PTR_ERR(host->clk);
 		goto error;
 	}
 
-	ret = clk_prepare_enable(host->clk);
-	if (ret)
-		goto error;
 	host->sys_freq = clk_get_rate(host->clk);
 
 	spin_lock_init(&host->irq_handler_lock);
@@ -163,7 +160,6 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
 			put_device(&host->slot_pdev[i]->dev);
 		}
 	}
-	clk_disable_unprepare(host->clk);
 	pci_release_regions(pdev);
 	return ret;
 }
@@ -182,7 +178,6 @@ static void thunder_mmc_remove(struct pci_dev *pdev)
 	dma_cfg &= ~MIO_EMM_DMA_CFG_EN;
 	writeq(dma_cfg, host->dma_base + MIO_EMM_DMA_CFG(host));
 
-	clk_disable_unprepare(host->clk);
 	pci_release_regions(pdev);
 }
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ