staging: iio: replace combine_8_to_16 with be16_to_cpup where possible.
[pandora-kernel.git] / drivers / staging / iio / imu / adis16300_ring.c
index 6b25f12..a76d43c 100644 (file)
 #include "../trigger.h"
 #include "adis16300.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, ADIS16300_SCAN_SUPPLY, IIO_UNSIGNED(14),
                     ADIS16300_SUPPLY_OUT, NULL);
 
@@ -158,10 +148,9 @@ static void adis16300_trigger_bh_to_ring(struct work_struct *work_s)
 
        if (st->indio_dev->scan_count)
                if (adis16300_spi_read_burst(&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)