diff mbox series

[U-Boot,1/5] dm: mmc: updated mmc_of_parse() to not fail because of an invalid bus-width

Message ID 1511277188-2923-2-git-send-email-jjhiblot@ti.com
State Superseded
Delegated to: Jaehoon Chung
Headers show
Series mmc: fixes for HS200/UHS core support | expand

Commit Message

Jean-Jacques Hiblot Nov. 21, 2017, 3:13 p.m. UTC
Instead of failing, the driver uses the default: 1-bit bus width.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---
 drivers/mmc/mmc-uclass.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Lukasz Majewski Nov. 22, 2017, 9:07 a.m. UTC | #1
On Tue, 21 Nov 2017 16:13:04 +0100
Jean-Jacques Hiblot <jjhiblot@ti.com> wrote:

> Instead of failing, the driver uses the default: 1-bit bus width.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
>  drivers/mmc/mmc-uclass.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
> index e30cde7..48fafce 100644
> --- a/drivers/mmc/mmc-uclass.c
> +++ b/drivers/mmc/mmc-uclass.c
> @@ -137,9 +137,10 @@ int mmc_of_parse(const void *fdt, int node,
> struct mmc_config *cfg) cfg->host_caps |= MMC_MODE_1BIT;
>  		break;
>  	default:
> -		printf("error: %s invalid bus-width property %d\n",
> -		       fdt_get_name(fdt, node, NULL), val);
> -		return -ENOENT;
> +		debug("warning: %s invalid bus-width property. using
> 1-bit\n",
> +		      fdt_get_name(fdt, node, NULL));
> +		cfg->host_caps |= MMC_MODE_1BIT;
> +		break;
>  	}
>  
>  	cfg->f_max = fdtdec_get_int(fdt, node, "max-frequency",
> 52000000);

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-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Simon Glass Nov. 24, 2017, 10:36 p.m. UTC | #2
Hi Jean-Jacques,


On 21 November 2017 at 08:13, Jean-Jacques Hiblot <jjhiblot@ti.com> wrote:
> Instead of failing, the driver uses the default: 1-bit bus width.
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
>  drivers/mmc/mmc-uclass.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
> index e30cde7..48fafce 100644
> --- a/drivers/mmc/mmc-uclass.c
> +++ b/drivers/mmc/mmc-uclass.c
> @@ -137,9 +137,10 @@ int mmc_of_parse(const void *fdt, int node, struct mmc_config *cfg)

Can you please add a function comment for this function in the header?

Also if you have time, this function should be converted to use live
tree - dev_read...() etc.

>                 cfg->host_caps |= MMC_MODE_1BIT;
>                 break;
>         default:
> -               printf("error: %s invalid bus-width property %d\n",
> -                      fdt_get_name(fdt, node, NULL), val);
> -               return -ENOENT;
> +               debug("warning: %s invalid bus-width property. using 1-bit\n",
> +                     fdt_get_name(fdt, node, NULL));
> +               cfg->host_caps |= MMC_MODE_1BIT;
> +               break;
>         }
>
>         cfg->f_max = fdtdec_get_int(fdt, node, "max-frequency", 52000000);
> --
> 1.9.1
>

Regards,
Simon
diff mbox series

Patch

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index e30cde7..48fafce 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -137,9 +137,10 @@  int mmc_of_parse(const void *fdt, int node, struct mmc_config *cfg)
 		cfg->host_caps |= MMC_MODE_1BIT;
 		break;
 	default:
-		printf("error: %s invalid bus-width property %d\n",
-		       fdt_get_name(fdt, node, NULL), val);
-		return -ENOENT;
+		debug("warning: %s invalid bus-width property. using 1-bit\n",
+		      fdt_get_name(fdt, node, NULL));
+		cfg->host_caps |= MMC_MODE_1BIT;
+		break;
 	}
 
 	cfg->f_max = fdtdec_get_int(fdt, node, "max-frequency", 52000000);