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

Guillaume GARDET guillaume.gardet at free.fr
Mon Apr 9 09:36:29 UTC 2018


sd_read_ssr returns 0 if it succeed.

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

---
 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)
-- 
2.13.6



More information about the U-Boot mailing list