Commit af3d5cad authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron

iio:adis16080: Use spi_sync_transfer()

Use the spi_sync_transfer() helper function instead of open-coding it. Makes
the code a bit shorter.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 66a18916
...@@ -51,7 +51,6 @@ static int adis16080_read_sample(struct iio_dev *indio_dev, ...@@ -51,7 +51,6 @@ static int adis16080_read_sample(struct iio_dev *indio_dev,
u16 addr, int *val) u16 addr, int *val)
{ {
struct adis16080_state *st = iio_priv(indio_dev); struct adis16080_state *st = iio_priv(indio_dev);
struct spi_message m;
int ret; int ret;
struct spi_transfer t[] = { struct spi_transfer t[] = {
{ {
...@@ -66,11 +65,7 @@ static int adis16080_read_sample(struct iio_dev *indio_dev, ...@@ -66,11 +65,7 @@ static int adis16080_read_sample(struct iio_dev *indio_dev,
st->buf = cpu_to_be16(addr | ADIS16080_DIN_WRITE); st->buf = cpu_to_be16(addr | ADIS16080_DIN_WRITE);
spi_message_init(&m); ret = spi_sync_transfer(st->us, t, ARRAY_SIZE(t));
spi_message_add_tail(&t[0], &m);
spi_message_add_tail(&t[1], &m);
ret = spi_sync(st->us, &m);
if (ret == 0) if (ret == 0)
*val = sign_extend32(be16_to_cpu(st->buf), 11); *val = sign_extend32(be16_to_cpu(st->buf), 11);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment