From: Lars-Peter Clausen Date: Sat, 5 Oct 2013 07:45:00 +0000 (+0100) Subject: staging:iio:adis16220: Use spi_sync_transfer() X-Git-Tag: v3.13-rc1~170^2~453^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63e4f052226dd9079409c22b55f38b1e50c5fb95;p=kernel%2Fkernel-generic.git staging:iio:adis16220: 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c index 5c28961..4c9364b 100644 --- a/drivers/staging/iio/accel/adis16220_core.c +++ b/drivers/staging/iio/accel/adis16220_core.c @@ -102,7 +102,6 @@ static ssize_t adis16220_capture_buffer_read(struct iio_dev *indio_dev, int addr) { struct adis16220_state *st = iio_priv(indio_dev); - struct spi_message msg; struct spi_transfer xfers[] = { { .tx_buf = st->tx, @@ -147,10 +146,7 @@ static ssize_t adis16220_capture_buffer_read(struct iio_dev *indio_dev, } xfers[1].len = count; - spi_message_init(&msg); - spi_message_add_tail(&xfers[0], &msg); - spi_message_add_tail(&xfers[1], &msg); - ret = spi_sync(st->adis.spi, &msg); + ret = spi_sync_transfer(st->adis.spi, xfers, ARRAY_SIZE(xfers)); if (ret) { mutex_unlock(&st->buf_lock);