diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-01-09 17:31:00 +0000 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 11:08:42 +0000 |
commit | 14543a00fc3ce6dac9f297535c502a0085a50467 (patch) | |
tree | 1c244bcc56bd4a48ee2c305856457d102d6eccbe /drivers/iio/dac/ad5791.c | |
parent | 6d9eecd418afb2c12e5db5be3d72f0f1df43bdd9 (diff) | |
download | op-kernel-dev-14543a00fc3ce6dac9f297535c502a0085a50467.zip op-kernel-dev-14543a00fc3ce6dac9f297535c502a0085a50467.tar.gz |
iio: Use spi_sync_transfer()
Use the new spi_sync_transfer() helper function instead of open-coding it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/dac/ad5791.c')
-rw-r--r-- | drivers/iio/dac/ad5791.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/iio/dac/ad5791.c b/drivers/iio/dac/ad5791.c index 6407b54..8dfd3da 100644 --- a/drivers/iio/dac/ad5791.c +++ b/drivers/iio/dac/ad5791.c @@ -125,7 +125,6 @@ static int ad5791_spi_read(struct spi_device *spi, u8 addr, u32 *val) u8 d8[4]; } data[3]; int ret; - struct spi_message msg; struct spi_transfer xfers[] = { { .tx_buf = &data[0].d8[1], @@ -144,10 +143,7 @@ static int ad5791_spi_read(struct spi_device *spi, u8 addr, u32 *val) AD5791_ADDR(addr)); data[1].d32 = cpu_to_be32(AD5791_ADDR(AD5791_ADDR_NOOP)); - spi_message_init(&msg); - spi_message_add_tail(&xfers[0], &msg); - spi_message_add_tail(&xfers[1], &msg); - ret = spi_sync(spi, &msg); + ret = spi_sync_transfer(spi, xfers, ARRAY_SIZE(xfers)); *val = be32_to_cpu(data[2].d32); |