Commit e33ff8ac authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: gyro: adis16130: Use get_unaligned_be24()

This makes the driver code slightly easier to read.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarNuno Sá <nuno.sa@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 6ef9d68b
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <asm/unaligned.h>
#define ADIS16130_CON 0x0 #define ADIS16130_CON 0x0
#define ADIS16130_CON_RD (1 << 6) #define ADIS16130_CON_RD (1 << 6)
#define ADIS16130_IOP 0x1 #define ADIS16130_IOP 0x1
...@@ -59,7 +61,7 @@ static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val) ...@@ -59,7 +61,7 @@ static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val)
ret = spi_sync_transfer(st->us, &xfer, 1); ret = spi_sync_transfer(st->us, &xfer, 1);
if (ret == 0) if (ret == 0)
*val = (st->buf[1] << 16) | (st->buf[2] << 8) | st->buf[3]; *val = get_unaligned_be24(&st->buf[1]);
mutex_unlock(&st->buf_lock); mutex_unlock(&st->buf_lock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment