diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-01-09 17:31:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 11:10:43 (GMT) |
commit | ad6c46b0c712e0d8fd8a80ee372b30f14a781888 (patch) | |
tree | 08a9dda620d1cc0280400b15ab518d30d374d68a /drivers/staging/iio/accel/sca3000_ring.c | |
parent | 14543a00fc3ce6dac9f297535c502a0085a50467 (diff) | |
download | linux-ad6c46b0c712e0d8fd8a80ee372b30f14a781888.tar.xz |
staging: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/staging/iio/accel/sca3000_ring.c')
-rw-r--r-- | drivers/staging/iio/accel/sca3000_ring.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c index cbec2f1..3e5e860 100644 --- a/drivers/staging/iio/accel/sca3000_ring.c +++ b/drivers/staging/iio/accel/sca3000_ring.c @@ -39,7 +39,6 @@ static int sca3000_read_data(struct sca3000_state *st, int len) { int ret; - struct spi_message msg; struct spi_transfer xfer[2] = { { .len = 1, @@ -55,10 +54,7 @@ static int sca3000_read_data(struct sca3000_state *st, } xfer[1].rx_buf = *rx_p; st->tx[0] = SCA3000_READ_REG(reg_address_high); - spi_message_init(&msg); - spi_message_add_tail(&xfer[0], &msg); - spi_message_add_tail(&xfer[1], &msg); - ret = spi_sync(st->us, &msg); + ret = spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); if (ret) { dev_err(get_device(&st->us->dev), "problem reading register"); goto error_free_rx; |