orion_spi: fix handling of default transfer speed
authorLennert Buytenhek <buytenh@wantstofly.org>
Fri, 3 Oct 2008 22:23:39 +0000 (15:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 Oct 2008 01:22:18 +0000 (18:22 -0700)
Accept zero (the default!) as a per-transfer clock speed override.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/orion_spi.c

index c4eaacd..b872bfa 100644 (file)
@@ -427,7 +427,7 @@ static int orion_spi_transfer(struct spi_device *spi, struct spi_message *m)
                        goto msg_rejected;
                }
 
-               if (t->speed_hz < orion_spi->min_speed) {
+               if (t->speed_hz && t->speed_hz < orion_spi->min_speed) {
                        dev_err(&spi->dev,
                                "message rejected : "
                                "device min speed (%d Hz) exceeds "