]> Pileus Git - ~andy/linux/blobdiff - drivers/spi/au1550_spi.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
[~andy/linux] / drivers / spi / au1550_spi.c
index 76cbc1a66598a87ad32fcfbcd3207c59f296a175..cfd5ff9508fadd2f607d33495b5066cc34b1bbd1 100644 (file)
@@ -237,8 +237,14 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)
        unsigned bpw, hz;
        u32 cfg, stat;
 
-       bpw = t ? t->bits_per_word : spi->bits_per_word;
-       hz = t ? t->speed_hz : spi->max_speed_hz;
+       bpw = spi->bits_per_word;
+       hz = spi->max_speed_hz;
+       if (t) {
+               if (t->bits_per_word)
+                       bpw = t->bits_per_word;
+               if (t->speed_hz)
+                       hz = t->speed_hz;
+       }
 
        if (bpw < 4 || bpw > 24) {
                dev_err(&spi->dev, "setupxfer: invalid bits_per_word=%d\n",