From 74de1afbd2ed4262d4105b12641de0c5c487d930 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 4 Mar 2019 10:48:39 +0100 Subject: 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 --- drivers/mci/Kconfig | 2 +- drivers/mci/mci_spi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig index 2075151d67..397dcf1377 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 011947c8c1..42072da58a 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); -- cgit v1.2.3