Skip to contentSkip to conversation

spi: orion: Let spi core handle validating transfer length

PATCH Applied Axel Lin 3 participants 7 messages Feb 25, 2014 – Mar 1, 2014

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/3 spi: orion: Let spi core handle validating transfer length

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

---
 drivers/spi/spi-orion.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/spi/spi-orion.c +0 -11
index 01bd85f..d018a4a 100644
@@ -295,17 +295,6 @@ static int orion_spi_transfer_one_message(struct spi_master *master,
 		goto msg_done;
 
 	list_for_each_entry(t, &m->transfers, transfer_list) {
-		/* make sure buffer length is even when working in 16
-		 * bit mode*/
-		if ((t->bits_per_word == 16) && (t->len & 1)) {
-			dev_err(&spi->dev,
-				"message rejected : "
-				"odd data length %d while in 16 bit mode\n",
-				t->len);
-			status = -EIO;
-			goto msg_done;
-		}
-
 		if (par_override || t->speed_hz || t->bits_per_word) {
 			par_override = 1;
 			status = orion_spi_setup_transfer(spi, t);
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#1 lore raw

PATCH 2/3 spi: s3c64xx: Let spi core handle validating transfer length

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

---
 drivers/spi/spi-s3c64xx.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/spi/spi-s3c64xx.c +0 -7
index 9ad5e3e..f19cd97 100644
@@ -697,13 +697,6 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
 	bpw = xfer->bits_per_word;
 	speed = xfer->speed_hz ? : spi->max_speed_hz;
 
-	if (xfer->len % (bpw / 8)) {
-		dev_err(&spi->dev,
-			"Xfer length(%u) not a multiple of word size(%u)\n",
-			xfer->len, bpw / 8);
-		return -EIO;
-	}
-
 	if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) {
 		sdd->cur_bpw = bpw;
 		sdd->cur_speed = speed;
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw

Re: [PATCH 2/3] spi: s3c64xx: Let spi core handle validating transfer length

Quoted 3 lines · Axel Lin

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

Applied, thanks.

author
#3 lore raw

PATCH 3/3 spi: txx9: Let spi core handle validating transfer length

In reply to Axel Lin

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

---
 drivers/spi/spi-txx9.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/spi/spi-txx9.c +0 -4
index 523f13d..b5f5dc8 100644
@@ -306,12 +306,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
 
 	/* check each transfer's parameters */
 	list_for_each_entry(t, &m->transfers, transfer_list) {
-		u8 bits_per_word = t->bits_per_word;
-
 		if (!t->tx_buf && !t->rx_buf && t->len)
 			return -EINVAL;
-		if (t->len & ((bits_per_word >> 3) - 1))
-			return -EINVAL;
 	}
 
 	spin_lock_irqsave(&c->lock, flags);
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] spi: txx9: Let spi core handle validating transfer length

Quoted 7 lines · Axel Lin

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

---
 drivers/spi/spi-txx9.c | 4 ----

Thank you. It looks good for me.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#5 lore raw

Re: [PATCH 3/3] spi: txx9: Let spi core handle validating transfer length

In reply to Axel Lin
Quoted 3 lines · Axel Lin

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

Applied, thanks.

Applied
#6 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message".
So remove the same checking in this driver.

Applied, thanks.