[2/7] spi: atmel: Let spi core validate Tx/Rx buffers for non-zero length transfer
diff mbox

Message ID 1395201313.16346.3.camel@phoenix
State New, archived
Headers show

Commit Message

Axel Lin March 19, 2014, 3:55 a.m. UTC
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-atmel.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Wenyou Yang March 19, 2014, 4:01 a.m. UTC | #1
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQXhlbCBMaW4gW21haWx0
bzpheGVsLmxpbkBpbmdpY3MuY29tXQ0KPiBTZW50OiBXZWRuZXNkYXksIE1hcmNoIDE5LCAyMDE0
IDExOjU1IEFNDQo+IFRvOiBNYXJrIEJyb3duDQo+IENjOiBZYW5nLCBXZW55b3U7IGxpbnV4LXNw
aUB2Z2VyLmtlcm5lbC5vcmcNCj4gU3ViamVjdDogW1BBVENIIDIvN10gc3BpOiBhdG1lbDogTGV0
IHNwaSBjb3JlIHZhbGlkYXRlIFR4L1J4IGJ1ZmZlcnMgZm9yDQo+IG5vbi16ZXJvIGxlbmd0aCB0
cmFuc2Zlcg0KPiANCj4gU2lnbmVkLW9mZi1ieTogQXhlbCBMaW4gPGF4ZWwubGluQGluZ2ljcy5j
b20+DQpBY2tlZC1ieTogV2VueW91LllhbmcgPHdlbnlvdS55YW5nQGF0bWVsLmNvbT4NCj4gLS0t
DQo+ICBkcml2ZXJzL3NwaS9zcGktYXRtZWwuYyB8IDUgLS0tLS0NCj4gIDEgZmlsZSBjaGFuZ2Vk
LCA1IGRlbGV0aW9ucygtKQ0KPiANCj4gZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3BpL3NwaS1hdG1l
bC5jIGIvZHJpdmVycy9zcGkvc3BpLWF0bWVsLmMgaW5kZXgNCj4gYmRhOTYxZS4uYzU0NDkyYiAx
MDA2NDQNCj4gLS0tIGEvZHJpdmVycy9zcGkvc3BpLWF0bWVsLmMNCj4gKysrIGIvZHJpdmVycy9z
cGkvc3BpLWF0bWVsLmMNCj4gQEAgLTEwNjUsMTEgKzEwNjUsNiBAQCBzdGF0aWMgaW50IGF0bWVs
X3NwaV9vbmVfdHJhbnNmZXIoc3RydWN0DQo+IHNwaV9tYXN0ZXIgKm1hc3RlciwNCj4gDQo+ICAJ
YXMgPSBzcGlfbWFzdGVyX2dldF9kZXZkYXRhKG1hc3Rlcik7DQo+IA0KPiAtCWlmICghKHhmZXIt
PnR4X2J1ZiB8fCB4ZmVyLT5yeF9idWYpICYmIHhmZXItPmxlbikgew0KPiAtCQlkZXZfZGJnKCZz
cGktPmRldiwgIm1pc3Npbmcgcnggb3IgdHggYnVmXG4iKTsNCj4gLQkJcmV0dXJuIC1FSU5WQUw7
DQo+IC0JfQ0KPiAtDQo+ICAJaWYgKHhmZXItPmJpdHNfcGVyX3dvcmQpIHsNCj4gIAkJYXNkID0g
c3BpLT5jb250cm9sbGVyX3N0YXRlOw0KPiAgCQliaXRzID0gKGFzZC0+Y3NyID4+IDQpICYgMHhm
Ow0KPiAtLQ0KPiAxLjguMy4yDQo+IA0KPiANCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index bda961e..c54492b 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1065,11 +1065,6 @@  static int atmel_spi_one_transfer(struct spi_master *master,
 
 	as = spi_master_get_devdata(master);
 
-	if (!(xfer->tx_buf || xfer->rx_buf) && xfer->len) {
-		dev_dbg(&spi->dev, "missing rx or tx buf\n");
-		return -EINVAL;
-	}
-
 	if (xfer->bits_per_word) {
 		asd = spi->controller_state;
 		bits = (asd->csr >> 4) & 0xf;