diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-04-28 02:14:19 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 08:58:31 -0700 |
commit | 06719814780da741e7acf587367a86c3965c03a2 (patch) | |
tree | a6d8aabc4b3068c3679630f318a1706044c195b1 /drivers/spi | |
parent | b687d2a8f8d46921ac5e80bf77967688afce68e2 (diff) | |
download | blackbird-op-linux-06719814780da741e7acf587367a86c3965c03a2.tar.gz blackbird-op-linux-06719814780da741e7acf587367a86c3965c03a2.zip |
atmel_spi: support zero length transfer
A spi transfer with zero length is not invalid. For example, such
transfer (len == 0 && delay_usecs != 0) can be used to achieve delay
before first CLK edge after chipselect assertion.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/atmel_spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 1749a27be066..02c8e305b14f 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -616,7 +616,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg) return -ESHUTDOWN; list_for_each_entry(xfer, &msg->transfers, transfer_list) { - if (!(xfer->tx_buf || xfer->rx_buf)) { + if (!(xfer->tx_buf || xfer->rx_buf) && xfer->len) { dev_dbg(&spi->dev, "missing rx or tx buf\n"); return -EINVAL; } |