treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr()
[platform/kernel/u-boot.git] / drivers / mmc / sti_sdhci.c
index d8b5888..5578fee 100644 (file)
@@ -1,12 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
- *  Copyright (c) 2017
- *  Patrice Chotard <patrice.chotard@st.com>
- *
- * SPDX-License-Identifier:    GPL-2.0
+ * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
+ * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
  */
 
 #include <common.h>
 #include <dm.h>
+#include <log.h>
 #include <mmc.h>
 #include <reset-uclass.h>
 #include <sdhci.h>
@@ -43,7 +43,7 @@ static int sti_mmc_core_config(struct udevice *dev)
        if (plat->instance) {
                ret = reset_deassert(&plat->reset);
                if (ret < 0) {
-                       error("MMC1 deassert failed: %d", ret);
+                       pr_err("MMC1 deassert failed: %d", ret);
                        return ret;
                }
        }
@@ -98,14 +98,14 @@ static int sti_sdhci_probe(struct udevice *dev)
                       SDHCI_QUIRK_NO_HISPD_BIT;
 
        host->host_caps = MMC_MODE_DDR_52MHz;
+       host->mmc = &plat->mmc;
+       host->mmc->dev = dev;
+       host->mmc->priv = host;
 
        ret = sdhci_setup_cfg(&plat->cfg, host, 50000000, 400000);
        if (ret)
                return ret;
 
-       host->mmc = &plat->mmc;
-       host->mmc->priv = host;
-       host->mmc->dev = dev;
        upriv->mmc = host->mmc;
 
        return sdhci_probe(dev);
@@ -116,7 +116,7 @@ static int sti_sdhci_ofdata_to_platdata(struct udevice *dev)
        struct sdhci_host *host = dev_get_priv(dev);
 
        host->name = strdup(dev->name);
-       host->ioaddr = (void *)devfdt_get_addr(dev);
+       host->ioaddr = dev_read_addr_ptr(dev);
 
        host->bus_width = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
                                         "bus-width", 4);