Geert Uytterhoeven e6456186ca spi: spidev: Restore all SPI mode flags on ioctl failure
In commit f477b7fb13df2b843997559ff34e87d054ba6538 ("spi: DUAL and QUAD
support"), spi_device.mode was enlarged from 8 to 16 bits.

However, the spidev code still only saved 8 bits of data. If a spidev
SPI_IOC_WR_MODE or SPI_IOC_WR_LSB_FIRST request failed, only the lower 8
bits of the SPI mode were restored, inadvertently clearing the upper 8
bits, possibly disabling Quad or Dual SPI transfers for the device.

Save up to 32 bits to fix this.

For SPI_IOC_WR_MODE this is probably not so important, as it doesn't allow
setting Quad or Dual mode anyway, but SPI_IOC_WR_LSB_FIRST is used to just
set or clear a single bit.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-27 13:50:33 +09:00
..
2014-01-25 13:20:36 -08:00
2013-12-17 22:53:36 +00:00
2013-11-14 11:04:38 -08:00
2013-12-31 12:30:18 +00:00
2013-12-09 17:31:38 +00:00
2014-01-13 11:30:41 +00:00
2014-01-25 13:20:36 -08:00
2014-01-25 13:20:36 -08:00
2014-01-25 13:20:36 -08:00
2014-01-25 13:20:36 -08:00