diff options
author | Pali Rohár <pali@kernel.org> | 2022-05-11 20:28:28 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-05-23 09:33:10 -0400 |
commit | c1abf7659c9b29874d9d718df6890de1638cedba (patch) | |
tree | 6f2400eadf598b14dd870d932474f889a8eb5503 | |
parent | 2d25f63cc02e42f3e4a798bd5385e9cd73e51fd4 (diff) | |
download | u-boot-c1abf7659c9b29874d9d718df6890de1638cedba.zip u-boot-c1abf7659c9b29874d9d718df6890de1638cedba.tar.gz u-boot-c1abf7659c9b29874d9d718df6890de1638cedba.tar.bz2 |
mmc: fsl_esdhc_spl: Fix checking for number of read sectors
Commit 0980cbba7b3c ("mmc: fsl_esdhc_spl: pre-PBL: implement redundancy
support") changed number of sectors which are read but did not adjusted
error check.
Fix it and check for if correct number of sectors were read.
Fixes: 0980cbba7b3c ("mmc: fsl_esdhc_spl: pre-PBL: implement redundancy support")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
-rw-r--r-- | drivers/mmc/fsl_esdhc_spl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c index ea8f4cd6..760f13d 100644 --- a/drivers/mmc/fsl_esdhc_spl.c +++ b/drivers/mmc/fsl_esdhc_spl.c @@ -106,7 +106,7 @@ again: blk_off = (sector * 512) % mmc->read_bl_len; blk_cnt = DIV_ROUND_UP(512, mmc->read_bl_len); err = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt, tmp_buf); - if (err != 1) { + if (err != blk_cnt) { puts("spl: mmc read failed!!\n"); hang(); } |