diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-01-09 18:31:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 12:08:42 +0100 |
commit | 14543a00fc3ce6dac9f297535c502a0085a50467 (patch) | |
tree | 1c244bcc56bd4a48ee2c305856457d102d6eccbe /drivers/iio/dac/ad5686.c | |
parent | spi: Add helper functions for setting up transfers (diff) | |
download | linux-14543a00fc3ce6dac9f297535c502a0085a50467.tar.xz linux-14543a00fc3ce6dac9f297535c502a0085a50467.zip |
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/ad5686.c')
-rw-r--r-- | drivers/iio/dac/ad5686.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c index ca9609d7a15c..5e554af21703 100644 --- a/drivers/iio/dac/ad5686.c +++ b/drivers/iio/dac/ad5686.c @@ -117,18 +117,13 @@ static int ad5686_spi_read(struct ad5686_state *st, u8 addr) .len = 3, }, }; - struct spi_message m; int ret; - spi_message_init(&m); - spi_message_add_tail(&t[0], &m); - spi_message_add_tail(&t[1], &m); - st->data[0].d32 = cpu_to_be32(AD5686_CMD(AD5686_CMD_READBACK_ENABLE) | AD5686_ADDR(addr)); st->data[1].d32 = cpu_to_be32(AD5686_CMD(AD5686_CMD_NOOP)); - ret = spi_sync(st->spi, &m); + ret = spi_sync_transfer(st->spi, t, ARRAY_SIZE(t)); if (ret < 0) return ret; |