summaryrefslogtreecommitdiff
path: root/drivers/mmc/rockchip_dw_mmc.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-08-07 16:24:06 +0300
committerSimon Glass <sjg@chromium.org>2021-09-25 18:46:15 +0300
commitdcfc42b12f95fecffbf4692854acd4193240d86a (patch)
tree0415ef0a2804ac9dff88bc8ecfd28cd39a740de2 /drivers/mmc/rockchip_dw_mmc.c
parent62470afed14a598d36d055c60ccc3ffab6967dcc (diff)
downloadu-boot-dcfc42b12f95fecffbf4692854acd4193240d86a.tar.xz
treewide: Try to avoid the preprocessor with OF_REAL
Convert some of these occurences to C code, where it is easy to do. This should help encourage this approach to be used in new code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mmc/rockchip_dw_mmc.c')
-rw-r--r--drivers/mmc/rockchip_dw_mmc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index fa297a0bc9..855c0e7af5 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -52,10 +52,12 @@ static uint rockchip_dwmmc_get_mmc_clk(struct dwmci_host *host, uint freq)
static int rockchip_dwmmc_of_to_plat(struct udevice *dev)
{
-#if CONFIG_IS_ENABLED(OF_REAL)
struct rockchip_dwmmc_priv *priv = dev_get_priv(dev);
struct dwmci_host *host = &priv->host;
+ if (!CONFIG_IS_ENABLED(OF_REAL))
+ return 0;
+
host->name = dev->name;
host->ioaddr = dev_read_addr_ptr(dev);
host->buswidth = dev_read_u32_default(dev, "bus-width", 4);
@@ -95,7 +97,7 @@ static int rockchip_dwmmc_of_to_plat(struct udevice *dev)
debug("%s: 'clock-freq-min-max' property was deprecated.\n",
__func__);
}
-#endif
+
return 0;
}