OSDN Git Service

staging:iio:adis16080: Cleanup SPI transfer
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 26 Jan 2013 10:22:04 +0000 (10:22 +0000)
commit9ab82f071125e340a052570df90813b11574f8d4
tree06f844daea93c51d511fab38d8633850f72a8095
parentc21ab7005140bdc5898907f73a5d73a86ea60a5d
staging:iio:adis16080: Cleanup SPI transfer

During sampling the driver currently does a spi_read followed by a spi_write.
This is not a problem per se, since CS needs to be deasserted between the two
transfers. So even if another device claims the bus between the two transfers we
should still get a result. But the code is actually spread out over multiple
functions. E.g. the spi_read happens in one function the spi_write in another,
this makes the code harder to follow. This patch re-factors the code to just use
a single spi transaction to do both the read and the write transfer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/gyro/adis16080_core.c