diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-07-11 15:39:12 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-07-22 18:38:28 (GMT) |
commit | f4658c898837ed2678422f3e69ee9d050e8e9cf8 (patch) | |
tree | c66793353d07288f126e24839f92e9f3d21f2415 /drivers/staging/iio/gyro/adis16260_ring.c | |
parent | 7b2c33b11ef003d83c87a58201ff42313e13eff4 (diff) | |
download | linux-fsl-qoriq-f4658c898837ed2678422f3e69ee9d050e8e9cf8.tar.xz |
staging: iio: replace combine_8_to_16 with be16_to_cpup where possible.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/gyro/adis16260_ring.c')
-rw-r--r-- | drivers/staging/iio/gyro/adis16260_ring.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/staging/iio/gyro/adis16260_ring.c b/drivers/staging/iio/gyro/adis16260_ring.c index 97d7660..57ebc8c 100644 --- a/drivers/staging/iio/gyro/adis16260_ring.c +++ b/drivers/staging/iio/gyro/adis16260_ring.c @@ -17,16 +17,6 @@ #include "../trigger.h" #include "adis16260.h" -/** - * combine_8_to_16() utility function to munge to u8s into u16 - **/ -static inline u16 combine_8_to_16(u8 lower, u8 upper) -{ - u16 _lower = lower; - u16 _upper = upper; - return _lower | (_upper << 8); -} - static IIO_SCAN_EL_C(supply, ADIS16260_SCAN_SUPPLY, IIO_UNSIGNED(12), ADIS16260_SUPPLY_OUT, NULL); static IIO_SCAN_EL_C(gyro, ADIS16260_SCAN_GYRO, IIO_SIGNED(14), @@ -134,10 +124,9 @@ static void adis16260_trigger_bh_to_ring(struct work_struct *work_s) if (st->indio_dev->scan_count) if (adis16260_read_ring_data(&st->indio_dev->dev, st->rx) >= 0) - for (; i < st->indio_dev->scan_count; i++) { - data[i] = combine_8_to_16(st->rx[i*2+1], - st->rx[i*2]); - } + for (; i < st->indio_dev->scan_count; i++) + data[i] = be16_to_cpup( + (__be16 *)&(st->rx[i*2])); /* Guaranteed to be aligned with 8 byte boundary */ if (st->indio_dev->scan_timestamp) |