Skip to contentSkip to conversation

mmc: Print error code for mmc_complete_init failure

PATCH New Jagan Teki 2 participants 2 messages Jan 10, 2017 – Jan 19, 2017 MMC, SD and SDIO

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 14/20 mmc: Print error code for mmc_complete_init failure

From: Jagan Teki <[email protected]>

Print the error code for non-zero (failure case) instead of making debug statement without any condition, this usually gives proper clue in failure condition.

Log:
---
MMC: FSL_SDHC: 0
mmc_init: -70, time 38
*** Warning - MMC init failed, using default environment

Cc Jaehoon Chung <[email protected]>
---
 drivers/mmc/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/mmc.c +3 -1
index 9f8368a..3648950 100644
@@ -1751,7 +1751,9 @@ int mmc_init(struct mmc *mmc)
 
 	if (!err)
 		err = mmc_complete_init(mmc);
-	debug("%s: %d, time %lu\n", __func__, err, get_timer(start));
+	if (err)
+		printf("%s: %d, time %lu\n", __func__, err, get_timer(start));
+
 	return err;
 }
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 14/20 mmc: Print error code for mmc_complete_init failure

Hi,

Quoted 6 lines · Jagan Teki

From: Jagan Teki <[email protected]>

Print the error code for non-zero (failure case) instead of making debug statement without any condition, this usually gives proper clue in failure condition.

Quoted 8 lines

Log:
---
MMC: FSL_SDHC: 0
mmc_init: -70, time 38
*** Warning - MMC init failed, using default environment

Cc Jaehoon Chung <[email protected]>

I didn't see the other patches..but i picked this patch on u-boot-mmc.

Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

Quoted 20 lines
---
 drivers/mmc/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/mmc.c +3 -1
index 9f8368a..3648950 100644
@@ -1751,7 +1751,9 @@ int mmc_init(struct mmc *mmc)
 
 	if (!err)
 		err = mmc_complete_init(mmc);
-	debug("%s: %d, time %lu\n", __func__, err, get_timer(start));
+	if (err)
+		printf("%s: %d, time %lu\n", __func__, err, get_timer(start));
+
 	return err;
 }