summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2011-04-29 14:17:00 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-03 11:40:01 -0700
commitcaca8c89c24d1fe1470aafacebe7d80910888235 (patch)
treea8b60029ac293c783242e42e795c273122cf126f /drivers/staging/iio
parent31f6a29a58c0c9aa5c6e13abe0b00b81bb3c9601 (diff)
downloadtalos-op-linux-caca8c89c24d1fe1470aafacebe7d80910888235.tar.gz
talos-op-linux-caca8c89c24d1fe1470aafacebe7d80910888235.zip
IIO: GYRO: ADXRS450: Cleanup result extraction and update license notice
Cleanup result extraction and update license notice, no functional changes. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/gyro/adxrs450_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/staging/iio/gyro/adxrs450_core.c
index a1a71b7bcad3..c02e3ef40a0f 100644
--- a/drivers/staging/iio/gyro/adxrs450_core.c
+++ b/drivers/staging/iio/gyro/adxrs450_core.c
@@ -3,7 +3,7 @@
*
* Copyright 2011 Analog Devices Inc.
*
- * Licensed under the GPL-2 or later.
+ * Licensed under the GPL-2.
*/
#include <linux/interrupt.h>
@@ -69,7 +69,7 @@ static int adxrs450_spi_read_reg_16(struct device *dev,
goto error_ret;
}
- *val = (st->rx[1] & 0x1f) << 11 | st->rx[2] << 3 | (st->rx[3] & 0xe0) >> 5;
+ *val = (be32_to_cpu(*(u32 *)st->rx) >> 5) & 0xFFFF;
error_ret:
mutex_unlock(&st->buf_lock);
@@ -152,7 +152,8 @@ static int adxrs450_spi_sensor_data(struct device *dev, u16 *val)
goto error_ret;
}
- *val = (st->rx[0] & 0x03) << 14 | st->rx[1] << 6 | (st->rx[2] & 0xfc) >> 2;
+ *val = (be32_to_cpu(*(u32 *)st->rx) >> 10) & 0xFFFF;
+
error_ret:
mutex_unlock(&st->buf_lock);
return ret;
OpenPOWER on IntegriCloud