All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atmel_spi: support zero length transfer
@ 2008-02-20 15:54 ` Atsushi Nemoto
  0 siblings, 0 replies; 33+ messages in thread
From: Atsushi Nemoto @ 2008-02-20 15:54 UTC (permalink / raw)
  To: Haavard Skinnemoen
  Cc: David Brownell,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

A spi transfer with zero length is not invalid.  Such transfer can be
used to achieve delay before first CLK edge after chipselect assertion.

Signed-off-by: Atsushi Nemoto <anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org>
---
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 293b7ca..5dff5e0 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -606,7 +606,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;
 		}

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2008-02-25  8:15 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 15:54 [PATCH] atmel_spi: support zero length transfer Atsushi Nemoto
2008-02-20 15:54 ` Atsushi Nemoto
     [not found] ` <20080221.005432.07645461.anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org>
2008-02-20 17:55   ` Marc Pignat
2008-02-20 17:55     ` Marc Pignat
     [not found]     ` <200802201855.02605.marc.pignat-7TsPiqsLilE@public.gmane.org>
2008-02-21  1:52       ` Atsushi Nemoto
2008-02-21  1:52         ` Atsushi Nemoto
     [not found]         ` <20080221.105233.41199605.nemoto-IGagC74glE2asRnM1LW+pc8NsWr+9BEh@public.gmane.org>
2008-02-21  9:26           ` Marc Pignat
2008-02-21  9:26             ` Marc Pignat
2008-02-21 19:23             ` David Brownell
     [not found]               ` <20080221192334.EE97A230A58-ZcXrCSuhvln6VZ3dlLfH/g4gEjPzgfUyLrfjE7I9kuVHxeISYlDBzl6hYfS7NtTn@public.gmane.org>
2008-02-22  9:30                 ` Marc Pignat
2008-02-22  9:30                   ` Marc Pignat
     [not found]                   ` <200802221030.32263.marc.pignat-7TsPiqsLilE@public.gmane.org>
2008-02-22 14:15                     ` Atsushi Nemoto
2008-02-22 14:15                       ` Atsushi Nemoto
     [not found]                       ` <20080222.231510.56565462.anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org>
2008-02-22 14:28                         ` Ned Forrester
2008-02-22 14:28                           ` [spi-devel-general] " Ned Forrester
2008-02-22 19:06                           ` David Brownell
     [not found]                             ` <20080222190613.0043B229B4D-ZcXrCSuhvln6VZ3dlLfH/g4gEjPzgfUyLrfjE7I9kuVHxeISYlDBzl6hYfS7NtTn@public.gmane.org>
2008-02-22 19:52                               ` Ned Forrester
2008-02-22 19:52                                 ` [spi-devel-general] " Ned Forrester
2008-02-22 18:58                         ` David Brownell
2008-02-22 18:58                           ` [spi-devel-general] " David Brownell
2008-02-23  2:55                     ` David Brownell
2008-02-23  2:55                       ` David Brownell
     [not found]                       ` <200802221855.25892.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-02-25  8:15                         ` Marc Pignat
2008-02-25  8:15                           ` Marc Pignat
2008-02-22 14:07                 ` Ned Forrester
2008-02-22 14:07                   ` [spi-devel-general] " Ned Forrester
2008-02-22 19:02                   ` David Brownell
     [not found]                     ` <20080222190228.2B0CB28E363-ZcXrCSuhvln6VZ3dlLfH/g4gEjPzgfUyLrfjE7I9kuVHxeISYlDBzl6hYfS7NtTn@public.gmane.org>
2008-02-22 19:36                       ` Ned Forrester
2008-02-22 19:36                         ` [spi-devel-general] " Ned Forrester
     [not found]                         ` <47BF2455.8030904-/d+BM93fTQY@public.gmane.org>
2008-02-23  2:37                           ` David Brownell
2008-02-23  2:37                             ` [spi-devel-general] " David Brownell
2008-02-25  0:25                           ` Atsushi Nemoto
2008-02-25  0:25                             ` [spi-devel-general] " Atsushi Nemoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.