aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2021-07-06 16:54:34 +0200
committerPeng Fan <peng.fan@nxp.com>2021-07-30 17:13:02 +0800
commit19e1da0c66454bd6206a4badfdc0077d7fd76aed (patch)
tree4e469b6dfa7f791ff7990fb67e087c99e488f824 /drivers/mmc
parent936e9cd39260559b6c3f931038fe3f2173e43605 (diff)
downloadu-boot-19e1da0c66454bd6206a4badfdc0077d7fd76aed.zip
u-boot-19e1da0c66454bd6206a4badfdc0077d7fd76aed.tar.gz
u-boot-19e1da0c66454bd6206a4badfdc0077d7fd76aed.tar.bz2
mmc: arm_pl180_mmci: Simplify code using dev_read_addr_ptr()
Simplify the code a bit by using dev_read_addr_ptr() instead of dev_read_addr(). This avoids having to cast explicitly to void*. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> on stm32f769-disco Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/arm_pl180_mmci.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index 5d1ee64..e632eed 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -526,14 +526,11 @@ static const struct dm_mmc_ops arm_pl180_dm_mmc_ops = {
static int arm_pl180_mmc_of_to_plat(struct udevice *dev)
{
struct pl180_mmc_host *host = dev_get_priv(dev);
- fdt_addr_t addr;
- addr = dev_read_addr(dev);
- if (addr == FDT_ADDR_T_NONE)
+ host->base = dev_read_addr_ptr(dev);
+ if (!host->base)
return -EINVAL;
- host->base = (void *)addr;
-
return 0;
}