spl: spl_mmc: fix mmc Falcon mode regression
authorTim Harvey <tharvey@gateworks.com>
Thu, 21 May 2015 22:57:16 +0000 (15:57 -0700)
committerStefano Babic <sbabic@denx.de>
Tue, 26 May 2015 12:26:27 +0000 (14:26 +0200)
91199f4a5a21a7cf9dd9e7c05e295a042f8c2b7e broke mmc based Falcon mode.

The block_read function returns the number of blocks read thus the error
check needs to look for a return of 0 blocks read.

Cc: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Paul Kocialkowski <contact@paulk.fr>
common/spl/spl_mmc.c

index 5d688d6f0fcbccc0c9d153930c5414c9032d10d7..c96345eff2dc0cf9ca85c6bb50b7494e614b43db 100644 (file)
@@ -76,7 +76,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
                                        CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
                                        CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
                                        (void *)CONFIG_SYS_SPL_ARGS_ADDR);
-       if (err) {
+       if (err == 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("spl: mmc block read error\n");
 #endif