]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/spi/spi_bitbang.c
i2c/scx200_acb: Don't use 0 as NULL pointer
[linux-2.6-omap-h63xx.git] / drivers / spi / spi_bitbang.c
index f7f8580edad86c9be126ce1b6abd97d7629ee261..71e881419cddaa6ba9c77f588ae6723ff633249a 100644 (file)
@@ -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 */