diff options
author | Giulio Benetti <giulio.benetti@benettiengineering.com> | 2020-01-10 17:51:45 +0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2020-01-15 00:54:00 +0300 |
commit | a820bedc45cb4f56561483f6c93249746d502493 (patch) | |
tree | 31ffa976694d099ef8423f25ba5a2b5b39ad0eee /drivers | |
parent | cd647fc4fb8e6018089d0e0a3dfa71bd6beffde4 (diff) | |
download | u-boot-a820bedc45cb4f56561483f6c93249746d502493.tar.xz |
mmc: fsl_esdhc: make if(CONFIG_IS_ENABLED(CLK)) an #if statement
Not all architectures(i.e. i.MXRT) support mxc_get_clock() and use DM_CLK
instead. So building could result in failure due to missing
mxc_get_clock().
Make if(CONFIG_IS_ENABLED(CLK)) an #if statement.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/fsl_esdhc_imx.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index a698184352..3416e9b04f 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -1523,27 +1523,27 @@ static int fsl_esdhc_probe(struct udevice *dev) init_clk_usdhc(dev->seq); - if (CONFIG_IS_ENABLED(CLK)) { - /* Assigned clock already set clock */ - ret = clk_get_by_name(dev, "per", &priv->per_clk); - if (ret) { - printf("Failed to get per_clk\n"); - return ret; - } - ret = clk_enable(&priv->per_clk); - if (ret) { - printf("Failed to enable per_clk\n"); - return ret; - } +#if CONFIG_IS_ENABLED(CLK) + /* Assigned clock already set clock */ + ret = clk_get_by_name(dev, "per", &priv->per_clk); + if (ret) { + printf("Failed to get per_clk\n"); + return ret; + } + ret = clk_enable(&priv->per_clk); + if (ret) { + printf("Failed to enable per_clk\n"); + return ret; + } - priv->sdhc_clk = clk_get_rate(&priv->per_clk); - } else { - priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev->seq); - if (priv->sdhc_clk <= 0) { - dev_err(dev, "Unable to get clk for %s\n", dev->name); - return -EINVAL; - } + priv->sdhc_clk = clk_get_rate(&priv->per_clk); +#else + priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev->seq); + if (priv->sdhc_clk <= 0) { + dev_err(dev, "Unable to get clk for %s\n", dev->name); + return -EINVAL; } +#endif ret = fsl_esdhc_init(priv, plat); if (ret) { |