clk: Fix error check in clk_set_default_parents()
[oweals/u-boot.git] / drivers / mmc / xenon_sdhci.c
index 2a0d8b46c6bffad907fedde9b3886cd93b3b52f9..829b75683b2c80c680aab56a12162949b38c8585 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Driver for Marvell SOC Platform Group Xenon SDHC as a platform device
  *
  *
  * Ported to from Marvell 2015.01 to mainline U-Boot 2017.01:
  * Stefan Roese <sr@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0
  */
 
 #include <common.h>
 #include <dm.h>
 #include <fdtdec.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <malloc.h>
 #include <sdhci.h>
 
@@ -159,7 +158,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host)
        }
 
        if (time <= 0) {
-               error("Failed to enable MMC internal clock in time\n");
+               pr_err("Failed to enable MMC internal clock in time\n");
                return -ETIMEDOUT;
        }
 
@@ -187,7 +186,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host)
        }
 
        if (time <= 0) {
-               error("Failed to init MMC PHY in time\n");
+               pr_err("Failed to init MMC PHY in time\n");
                return -ETIMEDOUT;
        }
 
@@ -327,7 +326,7 @@ static void xenon_mask_cmd_conflict_err(struct sdhci_host *host)
 }
 
 /* Platform specific function for post set_ios configuration */
-static void xenon_sdhci_set_ios_post(struct sdhci_host *host)
+static int xenon_sdhci_set_ios_post(struct sdhci_host *host)
 {
        struct xenon_sdhci_priv *priv = host->mmc->priv;
        uint speed = host->mmc->tran_speed;
@@ -365,6 +364,8 @@ static void xenon_sdhci_set_ios_post(struct sdhci_host *host)
 
        /* Re-init the PHY */
        xenon_mmc_phy_set(host);
+
+       return 0;
 }
 
 /* Install a driver specific handler for post set_ios configuration */
@@ -452,10 +453,10 @@ static int xenon_sdhci_ofdata_to_platdata(struct udevice *dev)
        const char *name;
 
        host->name = dev->name;
-       host->ioaddr = (void *)dev_get_addr(dev);
+       host->ioaddr = (void *)devfdt_get_addr(dev);
 
-       if (of_device_is_compatible(dev, "marvell,armada-3700-sdhci"))
-               priv->pad_ctrl_reg = (void *)dev_get_addr_index(dev, 1);
+       if (device_is_compatible(dev, "marvell,armada-3700-sdhci"))
+               priv->pad_ctrl_reg = (void *)devfdt_get_addr_index(dev, 1);
 
        name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "marvell,pad-type",
                           NULL);