[U-Boot] [PATCH 14/20] mmc: Print error code for mmc_complete_init failure

Jagan Teki jagan at openedev.com
Tue Jan 10 11:18:43 CET 2017


From: Jagan Teki <jagan at amarulasolutions.com>

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 <jh80.chung at samsung.com>
Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 drivers/mmc/mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 9f8368a..3648950 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -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;
 }
 
-- 
1.9.1



More information about the U-Boot mailing list