aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen2013-11-25 12:42:00 +0000
committerJonathan Cameron2013-12-03 20:22:27 +0000
commitb39c47d1930191120d290e664740ba7ae04d0134 (patch)
treeb7bf5162f10d9eeafb7d5266a1d3f92db8a60d5d
parent91f197e0c0ceda88c442f7adce6a84e5faa53586 (diff)
staging:iio:ad7280a: Mark transfer buffer as __be32
Fixes the following warnings from sparse: drivers/staging/iio/adc/ad7280a.c:194:35: warning: incorrect type in initializer (different base types) drivers/staging/iio/adc/ad7280a.c:194:35: expected unsigned int [unsigned] tx_buf drivers/staging/iio/adc/ad7280a.c:194:35: got restricted __be32 [usertype] <noident> drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32 drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32 drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32 drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32 drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32 drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32 drivers/staging/iio/adc/ad7280a.c:219:13: warning: incorrect type in assignment (different base types) drivers/staging/iio/adc/ad7280a.c:219:13: expected unsigned int [unsigned] [assigned] reg drivers/staging/iio/adc/ad7280a.c:219:13: got restricted __be32 [usertype] <noident> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/staging/iio/adc/ad7280a.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 8209fa542a8a..89ee65bdc279 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -191,7 +191,7 @@ static void ad7280_delay(struct ad7280_state *st)
static int __ad7280_read32(struct spi_device *spi, unsigned *val)
{
- unsigned rx_buf, tx_buf = cpu_to_be32(AD7280A_READ_TXVAL);
+ __be32 rx_buf, tx_buf = cpu_to_be32(AD7280A_READ_TXVAL);
int ret;
struct spi_transfer t = {
@@ -214,11 +214,12 @@ static int ad7280_write(struct ad7280_state *st, unsigned devaddr,
{
unsigned reg = (devaddr << 27 | addr << 21 |
(val & 0xFF) << 13 | all << 12);
+ __be32 tx_buf;
reg |= ad7280_calc_crc8(st->crc_tab, reg >> 11) << 3 | 0x2;
- reg = cpu_to_be32(reg);
+ tx_buf = cpu_to_be32(reg);
- return spi_write(st->spi, &reg, 4);
+ return spi_write(st->spi, &tx_buf, 4);
}
static int ad7280_read(struct ad7280_state *st, unsigned devaddr,