From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 2/8] iio:adis16080: Use spi_sync_transfer()
Date: Sat, 5 Oct 2013 09:45:02 +0200 [thread overview]
Message-ID: <1380959108-21775-2-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1380959108-21775-1-git-send-email-lars@metafoo.de>
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/gyro/adis16080.c | 7 +------
1 file changed, 1 insertion(+), 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);
--
1.8.0
next prev parent reply other threads:[~2013-10-05 7:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-05 7:45 [PATCH 1/8] iio:ad5449: Use spi_sync_transfer() Lars-Peter Clausen
2013-10-05 7:45 ` Lars-Peter Clausen [this message]
2013-10-05 10:59 ` [PATCH 2/8] iio:adis16080: " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380959108-21775-2-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).