]> git.ipfire.org Git - thirdparty/u-boot.git/commit
mmc: mmc_spi: correct the while condition
authorPragnesh Patel <pragnesh.patel@sifive.com>
Mon, 29 Jun 2020 09:47:24 +0000 (15:17 +0530)
committerPeng Fan <peng.fan@nxp.com>
Tue, 14 Jul 2020 08:19:39 +0000 (16:19 +0800)
commit3ba1d53c420c321a72312902b735680491988bad
tree4308c4bea08eb3e25227a7a3e5ae95bbfa5efb8e
parent497c7598c4e713eb9ad88fd7963e57b21b8b35e1
mmc: mmc_spi: correct the while condition

When variable i will become 0, while(i--) loop breaks but variable i will
again decrement to -1 because of i-- and that's why below condition
"if (!i && (r != resp_match_value)" will never execute, So doing "i--"
inside of while() loop solves this problem.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
drivers/mmc/mmc_spi.c