From: Atsushi Nemoto Date: Mon, 28 Apr 2008 09:14:19 +0000 (-0700) Subject: atmel_spi: support zero length transfer X-Git-Tag: v2.6.26-rc1~879 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=06719814780da741e7acf587367a86c3965c03a2;p=linux-2.6-omap-h63xx.git 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 Cc: Haavard Skinnemoen Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 1749a27be06..02c8e305b14 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; }