summaryrefslogtreecommitdiff
path: root/drivers/iio/dac/ad5449.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-07 23:49:35 (GMT)
commit62b8c978ee6b8d135d9e7953221de58000dba986 (patch)
tree683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/iio/dac/ad5449.c
parent78fd82238d0e5716578c326404184a27ba67fd6e (diff)
downloadlinux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/iio/dac/ad5449.c')
-rw-r--r--drivers/iio/dac/ad5449.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
index 82e208f..fff7d07 100644
--- a/drivers/iio/dac/ad5449.c
+++ b/drivers/iio/dac/ad5449.c
@@ -101,6 +101,7 @@ static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,
{
struct ad5449 *st = iio_priv(indio_dev);
int ret;
+ struct spi_message msg;
struct spi_transfer t[] = {
{
.tx_buf = &st->data[0],
@@ -113,11 +114,15 @@ static int ad5449_read(struct iio_dev *indio_dev, unsigned int addr,
},
};
+ spi_message_init(&msg);
+ spi_message_add_tail(&t[0], &msg);
+ spi_message_add_tail(&t[1], &msg);
+
mutex_lock(&indio_dev->mlock);
st->data[0] = cpu_to_be16(addr << 12);
st->data[1] = cpu_to_be16(AD5449_CMD_NOOP);
- ret = spi_sync_transfer(st->spi, t, ARRAY_SIZE(t));
+ ret = spi_sync(st->spi, &msg);
if (ret < 0)
goto out_unlock;