Message ID | 20200110145148.82233-3-giulio.benetti@benettiengineering.com |
---|---|
State | Accepted |
Commit | a820bedc45cb4f56561483f6c93249746d502493 |
Headers | show |
Series | Add i.MXRT family support | expand |
> 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 at benettiengineering.com> Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic
Hi Giulio, > 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 at benettiengineering.com> > --- > drivers/mmc/fsl_esdhc_imx.c | 38 > ++++++++++++++++++------------------- 1 file changed, 19 > insertions(+), 19 deletions(-) > > diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c > index f7b754bd9d..e015eb9661 100644 > --- a/drivers/mmc/fsl_esdhc_imx.c > +++ b/drivers/mmc/fsl_esdhc_imx.c > @@ -1515,27 +1515,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) { Reviewed-by: Lukasz Majewski <lukma at denx.de> Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200128/352ec16a/attachment.sig>
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index f7b754bd9d..e015eb9661 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -1515,27 +1515,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) {
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 at benettiengineering.com> --- drivers/mmc/fsl_esdhc_imx.c | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)