]> git.baikalelectronics.ru Git - kernel.git/commit
spi: bcm53xx: simplify reading SPI data
authorRafał Miłecki <rafal@milecki.pl>
Fri, 29 Dec 2017 13:48:02 +0000 (14:48 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 3 Jan 2018 11:39:16 +0000 (11:39 +0000)
commit33e1dd2a4615c7912959e8a0b483a8228877c1fe
tree992a37e28aa08a89441ff708581e0dd394aaea20
parentfc34a8d7a6e80eb2c2304f3fb1526e012599ae42
spi: bcm53xx: simplify reading SPI data

This commit makes transfer function use spi_transfer_is_last to
determine if currently processed transfer is the last one. Thanks to
that we finally set hardware registers properly and it makes controller
behave the way it's expected to.

This allows simplifying read function which can now simply start reading
from the slot 0 instead of the last saved offset. It has been
successfully tested using spi_write_then_read.

Moreover this change fixes handling messages with two writing transfers.
It's important for SPI flash devices as their drivers commonly use one
transfer for a command and another one for data.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm53xx.c