public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v2 18/21] mmc: fsl_esdhc: make if(CONFIG_IS_ENABLED(CLK)) an #if statement
Date: Tue, 28 Jan 2020 09:47:56 +0100	[thread overview]
Message-ID: <20200128094756.0064fea4@jawa> (raw)
In-Reply-To: <20200110145148.82233-3-giulio.benetti@benettiengineering.com>

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@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@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>

  parent reply	other threads:[~2020-01-28  8:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 14:51 [PATCH v2 16/21] serial_lpuart: add support for i.MXRT Giulio Benetti
2020-01-10 14:51 ` [PATCH v2 17/21] ram: add SDRAM driver for i.MXRT SoCs Giulio Benetti
2020-01-15 12:47   ` sbabic at denx.de
2020-01-28  8:46   ` Lukasz Majewski
2020-01-10 14:51 ` [PATCH v2 18/21] mmc: fsl_esdhc: make if(CONFIG_IS_ENABLED(CLK)) an #if statement Giulio Benetti
2020-01-15 12:47   ` sbabic at denx.de
2020-01-28  8:47   ` Lukasz Majewski [this message]
2020-01-10 14:51 ` [PATCH v2 19/21] mmc: fsl_esdhc: add compatible for fsl, imxrt-usdhc Giulio Benetti
2020-01-15 12:47   ` sbabic at denx.de
2020-01-28  8:49   ` Lukasz Majewski
2020-01-10 14:51 ` [PATCH v2 20/21] imx: Add basic support for the NXP IMXRT10xx SoC family Giulio Benetti
2020-01-15 12:46   ` sbabic at denx.de
2020-01-28  8:52   ` Lukasz Majewski
2020-01-10 14:51 ` [PATCH v2 21/21] imx: imxrt1050-evk: Add support for the NXP i.MXRT1050-EVK Giulio Benetti
2020-01-15 12:48   ` sbabic at denx.de
2020-01-28  9:02   ` Lukasz Majewski
2020-01-28 18:54     ` Giulio Benetti
2020-01-15 12:46 ` [PATCH v2 16/21] serial_lpuart: add support for i.MXRT sbabic at denx.de
2020-01-28  8:40 ` Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200128094756.0064fea4@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox