summaryrefslogtreecommitdiff
path: root/drivers/iio/gyro
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-10-05 07:45:00 (GMT)
committerJonathan Cameron <jic23@kernel.org>2013-10-05 10:58:54 (GMT)
commitaf3d5cad0a6699afcae84b578838e698f56028bb (patch)
treef2c3ad5dec0fcbb1057d1d18976ae18d990cc0a8 /drivers/iio/gyro
parent66a1891642cf71877ddb89945882281f5ef28672 (diff)
downloadlinux-af3d5cad0a6699afcae84b578838e698f56028bb.tar.xz
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: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r--drivers/iio/gyro/adis16080.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/gyro/adis16080.c b/drivers/iio/gyro/adis16080.c
index e9ec022..add5098 100644
--- a/drivers/iio/gyro/adis16080.c
+++ b/drivers/iio/gyro/adis16080.c
@@ -51,7 +51,6 @@ static int adis16080_read_sample(struct iio_dev *indio_dev,
u16 addr, int *val)
{
struct adis16080_state *st = iio_priv(indio_dev);
- struct spi_message m;
int ret;
struct spi_transfer t[] = {
{
@@ -66,11 +65,7 @@ static int adis16080_read_sample(struct iio_dev *indio_dev,
st->buf = cpu_to_be16(addr | ADIS16080_DIN_WRITE);
- spi_message_init(&m);
- spi_message_add_tail(&t[0], &m);
- spi_message_add_tail(&t[1], &m);
-
- ret = spi_sync(st->us, &m);
+ ret = spi_sync_transfer(st->us, t, ARRAY_SIZE(t));
if (ret == 0)
*val = sign_extend32(be16_to_cpu(st->buf), 11);