]> git.sur5r.net Git - u-boot/commitdiff
mmc: Add debug() output on read errors
authorSimon Glass <sjg@chromium.org>
Tue, 23 Jun 2015 21:38:50 +0000 (15:38 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 21 Jul 2015 23:39:25 +0000 (17:39 -0600)
Allow read errors to be diagnosed more easily.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/mmc/mmc.c

index 4eab274f732794b136ac4f88ac9231b42065cf33..da47037a3066260a5596d35c1cf033f7102c2afe 100644 (file)
@@ -250,14 +250,18 @@ static ulong mmc_bread(int dev_num, lbaint_t start, lbaint_t blkcnt, void *dst)
                return 0;
        }
 
-       if (mmc_set_blocklen(mmc, mmc->read_bl_len))
+       if (mmc_set_blocklen(mmc, mmc->read_bl_len)) {
+               debug("%s: Failed to set blocklen\n", __func__);
                return 0;
+       }
 
        do {
                cur = (blocks_todo > mmc->cfg->b_max) ?
                        mmc->cfg->b_max : blocks_todo;
-               if(mmc_read_blocks(mmc, dst, start, cur) != cur)
+               if (mmc_read_blocks(mmc, dst, start, cur) != cur) {
+                       debug("%s: Failed to read blocks\n", __func__);
                        return 0;
+               }
                blocks_todo -= cur;
                start += cur;
                dst += cur * mmc->read_bl_len;