Skip to contentSkip to conversation

mmc: fix return value check condition

PATCH In review Peng Fan 2 participants 3 messages Mar 5, 2018 – Apr 26, 2018 MMC, SD and SDIO

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 mmc: fix return value check condition

sd_read_ssr returns 0, means no error.

Fixes 5b2e72f32721484("mmc: read ssr only if MMC write support is enabled")
Cc Jaehoon Chung <[email protected]>
Cc Jean-Jacques Hiblot <[email protected]>
---
 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/mmc.c +1 -1
index c930893300..92ea78b8af 100644
@@ -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)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 mmc: fix return value check condition

Hi Peng,

Quoted 6 lines · Peng Fan

sd_read_ssr returns 0, means no error.

Fixes 5b2e72f32721484("mmc: read ssr only if MMC write support is enabled")
Cc Jaehoon Chung <[email protected]>
Cc Jean-Jacques Hiblot <[email protected]>

Will apply your patch. I have a problem about firewall exception for git.denx.de. After fixing my problem, re-send the email about applying a patch.

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/mmc.c +1 -1
index c930893300..92ea78b8af 100644
@@ -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 lore raw
In reply to Peng Fan

Hi,

Quoted 2 lines · Peng Fan

sd_read_ssr returns 0, means no error.

Fixes 5b2e72f32721484("mmc: read ssr only if MMC write support is enabled")

Sorry for late. Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

Quoted 22 lines
Cc Jaehoon Chung <[email protected]>
Cc Jean-Jacques Hiblot <[email protected]>
---
 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/mmc.c +1 -1
index c930893300..92ea78b8af 100644
@@ -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)