mmc: mmc_spi: Print verbose debug output when crc16 check fails
PATCH 1/1 mmc: mmc_spi: Print verbose debug output when crc16 check fails
Add some verbose debug output when crc16 check fails.
Signed-off-by Bin Meng <[email protected]>
---
drivers/mmc/mmc_spi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/mmc/mmc_spi.c +5 -2
@@ -181,8 +181,11 @@ static int mmc_spi_readdata(struct udevice *dev,if (ret)return ret;#ifdef CONFIG_MMC_SPI_CRC_ON -if (be16_to_cpu (crc16_ccitt (0 , buf, bsize)) != crc) { -debug ("%s: data crc error\n" , __func__); +u16 crc_ok; + crc_ok =be16_to_cpu (crc16_ccitt (0 , buf, bsize)); +if (crc_ok != crc) { +debug ("%s: data crc error, expect %04x get %04x\n" , + __func__, crc_ok, crc); r1 =R1_SPI_COM_CRC ;break ; }
Signature · 1 line
2.25.1
PATCH 1/1 mmc: mmc_spi: Print verbose debug output when crc16 check fails
Hi Bin,
Quoted 13 lines · Bin Meng
Add some verbose debug output when crc16 check fails.
Signed-off-by Bin Meng <[email protected]>---
drivers/mmc/mmc_spi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/mmc/mmc_spi.c +0
-0
drivers/mmc/mmc_spi.c static int mmc_spi_readdata(struct udevice *dev, · line 185
Quoted 7 lines
drivers/mmc/mmc_spi.c +2
-2@@ -181,8 +181,11 @@ static int mmc_spi_readdata(struct udevice *dev,if (ret)return ret;#ifdef CONFIG_MMC_SPI_CRC_ON -if (be16_to_cpu (crc16_ccitt (0 , buf, bsize)) != crc) { -debug ("%s: data crc error\n" , __func__); +u16 crc_ok; + crc_ok =be16_to_cpu (crc16_ccitt (0 , buf, bsize));
How about "u16 crc_ok = be16_to_cpu();" ?
Reviewed-by Jaehoon Chung <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 7 lines
drivers/mmc/mmc_spi.c +3
-0+if (crc_ok != crc) { +debug ("%s: data crc error, expect %04x get %04x\n" , + __func__, crc_ok, crc); r1 =R1_SPI_COM_CRC ;break ; }