spi: Remove SPI_BUFSIZ restriction on spi_write_then_read()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 2 Dec 2012 03:54:25 +0000 (12:54 +0900)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 6 Dec 2012 14:03:14 +0000 (14:03 +0000)
commitb3a223ee2d1a4635b0643c547bc0096a37334ed1
tree0b0e7891825af66e8ecfdc6e3f14bbf2b1941991
parent266904c77911fdc0a064d97e2f06034b824c23ac
spi: Remove SPI_BUFSIZ restriction on spi_write_then_read()

In order to avoid constantly allocating and deallocating there is a fixed
buffer which spi_write_then_read() uses for transfers, with an early error
check to ensure that the transfer fits within the buffer. This limits the
size of transfers to this size, currently max(32, SMP_CACHE_BYTES).

Since we can dynamically allocate and in fact already have a fallback
to do so when there is contention for the fixed buffer remove this
restriction and instead dynamically allocate a suitably sized buffer if
the transfer won't fit.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/spi.c