diff mbox series

[1/9] mmc: cavium-thunderx: Use devm_clk_get_enabled() helpers

Message ID 20240827074857.2671808-2-xirui.zhang@vivo.com (mailing list archive)
State New
Headers show
Series mmc: convert to devm_clk_get_enabled() API | expand

Commit Message

zhangxirui Aug. 27, 2024, 7:48 a.m. UTC
Use devm_clk_get_enabled() to simplify code
and avoids the calls to clk_disable_unprepare().

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

Patch

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);
 }