diff mbox series

[U-Boot,v4,06/20] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds

Message ID 1549039198-16674-7-git-send-email-abel.vesa@nxp.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series mx6sabre: Add DM and SPL FIT support | expand

Commit Message

Abel Vesa Feb. 1, 2019, 4:40 p.m. UTC
Since the fsl_esdhc will also be used by SPL, make the
preprocessor switches more generic to allow any kind of build.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---
 drivers/mmc/fsl_esdhc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Fabio Estevam Feb. 2, 2019, 9:42 a.m. UTC | #1
On Fri, Feb 1, 2019 at 2:44 PM Abel Vesa <abel.vesa@nxp.com> wrote:
>
> Since the fsl_esdhc will also be used by SPL, make the
> preprocessor switches more generic to allow any kind of build.
>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Lukasz Majewski Feb. 2, 2019, 9:48 p.m. UTC | #2
On Fri, 1 Feb 2019 16:40:11 +0000
Abel Vesa <abel.vesa@nxp.com> wrote:

> Since the fsl_esdhc will also be used by SPL, make the
> preprocessor switches more generic to allow any kind of build.
> 

The same here - as with ehci-mx6.
Thanks Abel for this patch.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
> ---
>  drivers/mmc/fsl_esdhc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index 21fa2ab..9e34557 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -804,7 +804,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
>  	case MMC_SIGNAL_VOLTAGE_330:
>  		if (priv->vs18_enable)
>  			return -EIO;
> -#ifdef CONFIG_DM_REGULATOR
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
>  			ret = regulator_set_value(priv->vqmmc_dev,
> 3300000); if (ret) {
> @@ -823,7 +823,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
>  
>  		return -EAGAIN;
>  	case MMC_SIGNAL_VOLTAGE_180:
> -#ifdef CONFIG_DM_REGULATOR
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
>  			ret = regulator_set_value(priv->vqmmc_dev,
> 1800000); if (ret) {
> @@ -1442,7 +1442,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
>  	int node = dev_of_offset(dev);
>  	struct esdhc_soc_data *data =
>  		(struct esdhc_soc_data *)dev_get_driver_data(dev);
> -#ifdef CONFIG_DM_REGULATOR
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  	struct udevice *vqmmc_dev;
>  #endif
>  	fdt_addr_t addr;
> @@ -1500,7 +1500,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
>  
>  	priv->vs18_enable = 0;
>  
> -#ifdef CONFIG_DM_REGULATOR
> +#if CONFIG_IS_ENABLED(DM_REGULATOR)
>  	/*
>  	 * If emmc I/O has a fixed voltage at 1.8V, this must be
> provided,
>  	 * otherwise, emmc will work abnormally.




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@denx.de
diff mbox series

Patch

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 21fa2ab..9e34557 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -804,7 +804,7 @@  static int esdhc_set_voltage(struct mmc *mmc)
 	case MMC_SIGNAL_VOLTAGE_330:
 		if (priv->vs18_enable)
 			return -EIO;
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
 			ret = regulator_set_value(priv->vqmmc_dev, 3300000);
 			if (ret) {
@@ -823,7 +823,7 @@  static int esdhc_set_voltage(struct mmc *mmc)
 
 		return -EAGAIN;
 	case MMC_SIGNAL_VOLTAGE_180:
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
 			ret = regulator_set_value(priv->vqmmc_dev, 1800000);
 			if (ret) {
@@ -1442,7 +1442,7 @@  static int fsl_esdhc_probe(struct udevice *dev)
 	int node = dev_of_offset(dev);
 	struct esdhc_soc_data *data =
 		(struct esdhc_soc_data *)dev_get_driver_data(dev);
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 	struct udevice *vqmmc_dev;
 #endif
 	fdt_addr_t addr;
@@ -1500,7 +1500,7 @@  static int fsl_esdhc_probe(struct udevice *dev)
 
 	priv->vs18_enable = 0;
 
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
 	/*
 	 * If emmc I/O has a fixed voltage at 1.8V, this must be provided,
 	 * otherwise, emmc will work abnormally.