]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/spi/spi_bitbang.c
Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / spi / spi_bitbang.c
index f7f8580edad86c9be126ce1b6abd97d7629ee261..96cc39ecb6e234f7340fbeb62322ea1831ba9e0d 100644 (file)
@@ -214,7 +214,7 @@ int spi_bitbang_setup(struct spi_device *spi)
                return retval;
 
        dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec/bit\n",
-                       __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA),
+                       __func__, spi->mode & (SPI_CPOL | SPI_CPHA),
                        spi->bits_per_word, 2 * cs->nsecs);
 
        /* NOTE we _need_ to call chipselect() early, ideally with adapter
@@ -344,12 +344,14 @@ static void bitbang_work(struct work_struct *work)
                                        t->rx_dma = t->tx_dma = 0;
                                status = bitbang->txrx_bufs(spi, t);
                        }
+                       if (status > 0)
+                               m->actual_length += status;
                        if (status != t->len) {
-                               if (status > 0)
-                                       status = -EMSGSIZE;
+                               /* always report some kind of error */
+                               if (status >= 0)
+                                       status = -EREMOTEIO;
                                break;
                        }
-                       m->actual_length += status;
                        status = 0;
 
                        /* protocol tweaks before next transfer */