summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-03-04 10:48:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-03-04 14:19:17 +0100
commit74de1afbd2ed4262d4105b12641de0c5c487d930 (patch)
tree925c267bb2196c4d59e8f41060fbd5bf4eeef81e /drivers
parent990100d9a75b2818a93b834df8bf14aa02c6c8e7 (diff)
downloadbarebox-74de1afbd2ed4262d4105b12641de0c5c487d930.tar.gz
crc: import crc_itu_t() from kernel
Our cyc_crc16() function is the same function as crc_itu_t() in the Linux kernel. Import and use crc_itu_t() from the Kernel for consistency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mci/Kconfig2
-rw-r--r--drivers/mci/mci_spi.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig
index 2075151..397dcf1 100644
--- a/drivers/mci/Kconfig
+++ b/drivers/mci/Kconfig
@@ -141,7 +141,7 @@ config MCI_SPI
config MMC_SPI_CRC_ON
bool "Enable CRC protection for transfers"
- select CRC16
+ select CRC_ITU_T
depends on MCI_SPI
help
Enable CRC protection for transfers
diff --git a/drivers/mci/mci_spi.c b/drivers/mci/mci_spi.c
index 011947c..42072da 100644
--- a/drivers/mci/mci_spi.c
+++ b/drivers/mci/mci_spi.c
@@ -166,7 +166,7 @@ static uint mmc_spi_readdata(struct mmc_spi_host *host, void *xbuf,
mmc_spi_readbytes(host, bsize, buf);
mmc_spi_readbytes(host, 2, &crc);
#ifdef CONFIG_MMC_SPI_CRC_ON
- if (be16_to_cpu(cyg_crc16(buf, bsize)) != crc) {
+ if (be16_to_cpu(crc_itu_t(0, buf, bsize)) != crc) {
dev_dbg(host->dev, "%s: CRC error\n", __func__);
r1 = R1_SPI_COM_CRC;
break;
@@ -197,7 +197,7 @@ static uint mmc_spi_writedata(struct mmc_spi_host *host, const void *xbuf,
while (bcnt--) {
#ifdef CONFIG_MMC_SPI_CRC_ON
- crc = be16_to_cpu(cyg_crc16((u8 *)buf, bsize));
+ crc = be16_to_cpu(crc_itu_t(0, (u8 *)buf, bsize));
#endif
mmc_spi_writebytes(host, 2, tok);
mmc_spi_writebytes(host, bsize, (void *)buf);