summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2018-05-16 10:57:07 +0200
committerMichal Simek <michal.simek@xilinx.com>2018-05-31 13:50:39 +0200
commit458e8d8071f2db7addbfe1fa67951a95c05d28b6 (patch)
treebdc7dd7dae513e1d7b47dc6bbb8b9a2ce6333154 /drivers/mmc
parentce69030eb9d600173d6ce801c3158f685721fe79 (diff)
mmc: zynq: Use live-tree functions
Use live-tree functions. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/zynq_sdhci.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index f99731fb1f..1f6d053f96 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -283,25 +283,21 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
return -1;
priv->host->name = dev->name;
- priv->host->ioaddr = (void *)devfdt_get_addr(dev);
-
- priv->deviceid = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
- "xlnx,device_id", -1);
- priv->bank = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
- "xlnx,mio_bank", -1);
- if (fdt_get_property(gd->fdt_blob, dev_of_offset(dev),
- "no-1-8-v", NULL))
- priv->no_1p8 = 1;
- else
- priv->no_1p8 = 0;
#if defined(CONFIG_DM_MMC) && defined(CONFIG_ARCH_ZYNQMP)
priv->host->ops = &arasan_ops;
#endif
- plat->f_max = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
- "max-frequency", CONFIG_ZYNQ_SDHCI_MAX_FREQ);
+ priv->host->ioaddr = (void *)dev_read_addr(dev);
+ if (IS_ERR(priv->host->ioaddr))
+ return PTR_ERR(priv->host->ioaddr);
+ priv->deviceid = dev_read_u32_default(dev, "xlnx,device_id", -1);
+ priv->bank = dev_read_u32_default(dev, "xlnx,mio_bank", -1);
+ priv->no_1p8 = dev_read_bool(dev, "no-1-8-v");
+
+ plat->f_max = dev_read_u32_default(dev, "max-frequency",
+ CONFIG_ZYNQ_SDHCI_MAX_FREQ);
return 0;
}