Message ID | CAOMZO5B1NPceOihz6i_sPoydbvsr6VfHD-rH1AjganHtiSQx_A@mail.gmail.com |
---|---|
State | Changes Requested |
Headers | show |
--- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -126,17 +126,14 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, { struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave); struct mx28_ssp_regs *ssp_regs = mxs_slave->regs; - int len = bitlen / 8; + unsigned int len = bitlen / 8; const char *tx = dout; char *rx = din; - if (bitlen == 0) - return 0; - if (!rx && !tx) return 0; - if (flags & SPI_XFER_BEGIN) + if ((flags & SPI_XFER_BEGIN) && !len) mxs_spi_start_xfer(ssp_regs); while (len--) {