diff mbox series

[U-Boot] mmc: fix check of returned value of sd_read_ssr function

Message ID 20180409093629.10264-1-guillaume.gardet@free.fr
State Deferred
Delegated to: Jaehoon Chung
Headers show
Series [U-Boot] mmc: fix check of returned value of sd_read_ssr function | expand

Commit Message

Guillaume GARDET April 9, 2018, 9:36 a.m. UTC
sd_read_ssr returns 0 if it succeed.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Jaehoon Chung <jh80.chung@samsung.com>

---
 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jaehoon Chung April 26, 2018, 10:31 a.m. UTC | #1
On 04/09/2018 06:36 PM, Guillaume GARDET wrote:
> sd_read_ssr returns 0 if it succeed.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index c930893300..92ea78b8af 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1689,7 +1689,7 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
>  
>  #if CONFIG_IS_ENABLED(MMC_WRITE)
>  				err = sd_read_ssr(mmc);
> -				if (!err)
> +				if (err)
>  					pr_warn("unable to read ssr\n");
>  #endif
>  				if (!err)
>
Jaehoon Chung April 26, 2018, 10:31 a.m. UTC | #2
Hi,

On 04/09/2018 06:36 PM, Guillaume GARDET wrote:
> sd_read_ssr returns 0 if it succeed.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>

Sorry for late. it's already sent the patch from Peng.
It's applied to u-boot-mmc. Thanks for reporting.

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index c930893300..92ea78b8af 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1689,7 +1689,7 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
>  
>  #if CONFIG_IS_ENABLED(MMC_WRITE)
>  				err = sd_read_ssr(mmc);
> -				if (!err)
> +				if (err)
>  					pr_warn("unable to read ssr\n");
>  #endif
>  				if (!err)
>
diff mbox series

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index c930893300..92ea78b8af 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1689,7 +1689,7 @@  static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
 
 #if CONFIG_IS_ENABLED(MMC_WRITE)
 				err = sd_read_ssr(mmc);
-				if (!err)
+				if (err)
 					pr_warn("unable to read ssr\n");
 #endif
 				if (!err)