]> git.ipfire.org Git - people/arne_f/kernel.git/commit
spi: fsl: Fix problem with multi message transfers
authorStefan Roese <sr@denx.de>
Fri, 31 Jan 2014 12:44:59 +0000 (13:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2015 14:59:34 +0000 (06:59 -0800)
commit2937d5ac11c421a02f276295f388994027bbe607
treef09d92cf639952150866441235de698edbce10b0
parentceaefcdf2a9f24835691d58d45c5cc50d596a7d0
spi: fsl: Fix problem with multi message transfers

commit 4302a59629f7a0bd70fd1605d2b558597517372a upstream.

When used via spidev with more than one messages to tranfer via
SPI_IOC_MESSAGE the current implementation would return with
-EINVAL, since bits_per_word and speed_hz are set in all
transfer structs. And in the 2nd loop status will stay at
-EINVAL as its not overwritten again via fsl_spi_setup_transfer().

This patch changes this behavious by first checking if one of
the messages uses different settings. If this is the case
the function will return with -EINVAL. If not, the messages
are transferred correctly.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: Esben Haabendal <esbenhaabendal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-fsl-spi.c