From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>,
Jean Delvare <khali@linux-fr.org>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Cameron <jic23@kernel.org>
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, linux-spi@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 2/3] hwmon: (adt7310) Use spi_w8r16be() instead spi_w8r16()
Date: Fri, 27 Sep 2013 16:34:28 +0200 [thread overview]
Message-ID: <1380292469-17347-2-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1380292469-17347-1-git-send-email-lars@metafoo.de>
Using spi_w8r16be() instead of spi_w8r16() in this driver makes a code a bit
shorter and cleaner.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/hwmon/adt7310.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/hwmon/adt7310.c b/drivers/hwmon/adt7310.c
index da5f078..5994cf6 100644
--- a/drivers/hwmon/adt7310.c
+++ b/drivers/hwmon/adt7310.c
@@ -42,13 +42,8 @@ static const u8 adt7310_reg_table[] = {
static int adt7310_spi_read_word(struct device *dev, u8 reg)
{
struct spi_device *spi = to_spi_device(dev);
- int ret;
- ret = spi_w8r16(spi, AD7310_COMMAND(reg) | ADT7310_CMD_READ);
- if (ret < 0)
- return ret;
-
- return be16_to_cpu((__force __be16)ret);
+ return spi_w8r16be(spi, AD7310_COMMAND(reg) | ADT7310_CMD_READ);
}
static int adt7310_spi_write_word(struct device *dev, u8 reg, u16 data)
--
1.8.0
next prev parent reply other threads:[~2013-09-27 14:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 14:34 [PATCH 1/3] spi: Add a spi_w8r16be() helper Lars-Peter Clausen
2013-09-27 14:34 ` Lars-Peter Clausen [this message]
2013-09-27 16:12 ` [PATCH 2/3] hwmon: (adt7310) Use spi_w8r16be() instead spi_w8r16() Guenter Roeck
2013-10-03 12:53 ` Mark Brown
2013-09-27 14:34 ` [PATCH 3/3] staging:iio:ade7753/ade7754/ade7759: Use spi_w8r16be() instead of spi_w8r16() Lars-Peter Clausen
2013-09-28 10:42 ` Jonathan Cameron
2013-09-27 18:34 ` [PATCH 1/3] spi: Add a spi_w8r16be() helper Mark Brown
2013-09-27 18:46 ` Lars-Peter Clausen
2013-09-27 19:22 ` Mark Brown
2013-09-27 20:01 ` Lars-Peter Clausen
2013-09-29 12:30 ` Mark Brown
2013-10-03 10:39 ` Lars-Peter Clausen
2013-10-03 10:59 ` Mark Brown
2013-09-27 20:42 ` Guenter Roeck
2013-10-03 12:52 ` Mark Brown
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=1380292469-17347-2-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=broonie@kernel.org \
--cc=jic23@kernel.org \
--cc=khali@linux-fr.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lm-sensors@lm-sensors.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).