diff mbox

[4/7] spi: omap2-mcspi: Let spi core validate Tx/Rx buffers for non-zero length transfer

Message ID 1395201458.16346.6.camel@phoenix (mailing list archive)
State New, archived
Headers show

Commit Message

Axel Lin March 19, 2014, 3:57 a.m. UTC
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-omap2-mcspi.c | 14 --------------
 1 file changed, 14 deletions(-)
diff mbox

Patch

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 2941c5b..a0746a7 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1081,10 +1081,6 @@  static void omap2_mcspi_work(struct omap2_mcspi *mcspi, struct spi_message *m)
 
 	omap2_mcspi_set_enable(spi, 0);
 	list_for_each_entry(t, &m->transfers, transfer_list) {
-		if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) {
-			status = -EINVAL;
-			break;
-		}
 		if (par_override ||
 		    (t->speed_hz != spi->max_speed_hz) ||
 		    (t->bits_per_word != spi->bits_per_word)) {
@@ -1212,16 +1208,6 @@  static int omap2_mcspi_transfer_one_message(struct spi_master *master,
 		void		*rx_buf = t->rx_buf;
 		unsigned	len = t->len;
 
-		if ((len && !(rx_buf || tx_buf))) {
-			dev_dbg(mcspi->dev, "transfer: %d Hz, %d %s%s, %d bpw\n",
-					t->speed_hz,
-					len,
-					tx_buf ? "tx" : "",
-					rx_buf ? "rx" : "",
-					t->bits_per_word);
-			return -EINVAL;
-		}
-
 		if (m->is_dma_mapped || len < DMA_MIN_BYTES)
 			continue;