diff options
author | Bin Meng <bin.meng@windriver.com> | 2021-02-02 10:48:46 +0800 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2021-02-19 15:07:30 +0800 |
commit | 781aad0de93aedf94a17cc66b2f211bf156b718e (patch) | |
tree | 19b029508a6cd67b174003aa1f5b0561d85023a4 /drivers/mmc | |
parent | 01962f8d7ced3d8b9748d3b902f7f9b68587c426 (diff) | |
download | u-boot-781aad0de93aedf94a17cc66b2f211bf156b718e.tar.gz |
mmc: mmc_spi: Move argument check to the beginning of mmc_spi_sendcmd()
The argument check should happen before any transfer on the SPI lines.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/mmc_spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 23b907328c..a06862aa48 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -78,6 +78,9 @@ static int mmc_spi_sendcmd(struct udevice *dev, int i, rpos = 0, ret = 0; u8 cmdo[7], r; + if (!resp || !resp_size) + return 0; + debug("%s: cmd%d cmdarg=0x%x resp_type=0x%x " "resp_size=%d resp_match=%d resp_match_value=0x%x\n", __func__, cmdidx, cmdarg, resp_type, @@ -98,9 +101,6 @@ static int mmc_spi_sendcmd(struct udevice *dev, if (ret) return ret; - if (!resp || !resp_size) - return 0; - debug("%s: cmd%d", __func__, cmdidx); if (resp_match) { |