linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] iio:ad5449: Use spi_sync_transfer()
@ 2013-10-05  7:45 Lars-Peter Clausen
  2013-10-05  7:45 ` [PATCH 2/8] iio:adis16080: " Lars-Peter Clausen
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Lars-Peter Clausen @ 2013-10-05  7:45 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen

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>
---
 drivers/iio/dac/ad5449.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/iio/dac/ad5449.c b/drivers/iio/dac/ad5449.c
index fff7d07..82e208f 100644
--- a/drivers/iio/dac/ad5449.c
+++ b/drivers/iio/dac/ad5449.c
@@ -101,7 +101,6 @@ 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],
@@ -114,15 +113,11 @@ 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(st->spi, &msg);
+	ret = spi_sync_transfer(st->spi, t, ARRAY_SIZE(t));
 	if (ret < 0)
 		goto out_unlock;
 
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-10-05 10:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-05  7:45 [PATCH 1/8] iio:ad5449: Use spi_sync_transfer() Lars-Peter Clausen
2013-10-05  7:45 ` [PATCH 2/8] iio:adis16080: " Lars-Peter Clausen
2013-10-05 10:59   ` Jonathan Cameron
2013-10-05  7:45 ` [PATCH 3/8] iio:adxrs450: " Lars-Peter Clausen
2013-10-05 10:59   ` Jonathan Cameron
2013-10-05  7:45 ` [PATCH 4/8] iio:adis16130: " Lars-Peter Clausen
2013-10-05 11:00   ` Jonathan Cameron
2013-10-05 11:00   ` Jonathan Cameron
2013-10-05  7:45 ` [PATCH 5/8] staging:iio:adis16220: " Lars-Peter Clausen
2013-10-05 11:01   ` Jonathan Cameron
2013-10-05  7:45 ` [PATCH 6/8] staging:iio:ad9852: " Lars-Peter Clausen
2013-10-05 11:01   ` Jonathan Cameron
2013-10-05  7:45 ` [PATCH 7/8] staging:iio:ad9910: " Lars-Peter Clausen
2013-10-05 11:01   ` Jonathan Cameron
2013-10-05  7:45 ` [PATCH 8/8] staging:iio:ad9951: " Lars-Peter Clausen
2013-10-05 11:02   ` Jonathan Cameron
2013-10-05 10:58 ` [PATCH 1/8] iio:ad5449: " Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).