txbuflen can be set to arbitrary value by user and it is also set
automagically to the maximum transfer size of the SPI master controller.
Do not allocate the buffer when larger than vmem. When my SPI master
controller reports maximum transfer size 16M the probe of fbtft fails.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* Transmit buffer */
if (txbuflen == -1)
txbuflen = vmem_size + 2; /* add in case startbyte is used */
+ if (txbuflen >= vmem_size + 2)
+ txbuflen = 0;
#ifdef __LITTLE_ENDIAN
if ((!txbuflen) && (bpp > 8))