spi/bcm63xx: don't reject reads >= 256 bytes
authorJonas Gorski <jogo@openwrt.org>
Tue, 17 Dec 2013 20:42:08 +0000 (21:42 +0100)
committerMark Brown <broonie@linaro.org>
Tue, 17 Dec 2013 22:40:19 +0000 (22:40 +0000)
The rx_tail register is only 8 bit wide, so it will wrap around
after 256 read bytes. This makes it rather meaningless, so drop any
usage of it to not treat reads over 256 as failed.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-bcm63xx.c

index 7b4ead78782c286e4163075168f38151ba2f76e3..e20a669c190cbbdf8b68a39e765d65f1fb39b007 100644 (file)
@@ -205,13 +205,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,
        if (!timeout)
                return -ETIMEDOUT;
 
-       /* read out all data */
-       rx_tail = bcm_spi_readb(bs, SPI_RX_TAIL);
-
-       if (do_rx && rx_tail != len)
-               return -EIO;
-
-       if (!rx_tail)
+       if (!do_rx)
                return 0;
 
        len = 0;