]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: arm_pl180_mmci: Simplify code using dev_read_addr_ptr()
authorStephan Gerhold <stephan@gerhold.net>
Tue, 6 Jul 2021 14:54:34 +0000 (16:54 +0200)
committerPeng Fan <peng.fan@nxp.com>
Fri, 30 Jul 2021 09:13:02 +0000 (17:13 +0800)
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>
drivers/mmc/arm_pl180_mmci.c

index 5d1ee64356eebff2830a71b765c237ebee615e75..e632eed03fa34feec9e9b646c8a3da9134479c57 100644 (file)
@@ -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;
 }