summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/mxs_spi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 4c27fef..adb9ca8 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -129,9 +129,15 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
int len = bitlen / 8;
const char *tx = dout;
char *rx = din;
-
- if (bitlen == 0)
- return 0;
+ char dummy;
+
+ if (bitlen == 0) {
+ if (flags & SPI_XFER_END) {
+ rx = &dummy;
+ len = 1;
+ } else
+ return 0;
+ }
if (!rx && !tx)
return 0;