[v2,03/11] mmc: sdhci-of-arasan: Replace deprecated clk API calls
diff mbox series

Message ID 1561958991-21935-4-git-send-email-manish.narani@xilinx.com
State New
Headers show
Series
  • Arasan SDHCI enhancements and ZynqMP Tap Delays Handling
Related show

Commit Message

Manish Narani July 1, 2019, 5:29 a.m. UTC
The clk framework APIs devm_clk_register and of_clk_add_provider, which
are used here, are deprecated. Replace the calls with the new API calls.
Also add an API call devm_clk_get() to get the clock from DT.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

Patch
diff mbox series

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index b12abf9..d60a2e8 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -641,14 +641,25 @@  static int sdhci_arasan_register_sdclk(struct sdhci_arasan_data *sdhci_arasan,
 	sdcardclk_init.ops = &arasan_sdcardclk_ops;
 
 	sdhci_arasan->sdcardclk_hw.init = &sdcardclk_init;
-	sdhci_arasan->sdcardclk =
-		devm_clk_register(dev, &sdhci_arasan->sdcardclk_hw);
+	ret = devm_clk_hw_register(dev, &sdhci_arasan->sdcardclk_hw);
+	if (ret) {
+		dev_err(dev, "Failed to register SD clk_hw\n");
+		return ret;
+	}
 	sdhci_arasan->sdcardclk_hw.init = NULL;
 
-	ret = of_clk_add_provider(np, of_clk_src_simple_get,
-				  sdhci_arasan->sdcardclk);
-	if (ret)
+	ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get,
+				     &sdhci_arasan->sdcardclk_hw);
+	if (ret) {
 		dev_err(dev, "Failed to add clock provider\n");
+		return ret;
+	}
+
+	sdhci_arasan->sdcardclk = devm_clk_get(dev, "clk_sdcard");
+	if (IS_ERR(sdhci_arasan->sdcardclk)) {
+		dev_err(dev, "sdcardclk clock not found.\n");
+		ret = PTR_ERR(sdhci_arasan->sdcardclk);
+	}
 
 	return ret;
 }