Commit caca8c89 authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

IIO: GYRO: ADXRS450: Cleanup result extraction and update license notice

Cleanup result extraction and update license notice, no functional changes.
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 31f6a29a
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2011 Analog Devices Inc. * Copyright 2011 Analog Devices Inc.
* *
* Licensed under the GPL-2 or later. * Licensed under the GPL-2.
*/ */
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -69,7 +69,7 @@ static int adxrs450_spi_read_reg_16(struct device *dev, ...@@ -69,7 +69,7 @@ static int adxrs450_spi_read_reg_16(struct device *dev,
goto error_ret; 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: error_ret:
mutex_unlock(&st->buf_lock); mutex_unlock(&st->buf_lock);
...@@ -152,7 +152,8 @@ static int adxrs450_spi_sensor_data(struct device *dev, u16 *val) ...@@ -152,7 +152,8 @@ static int adxrs450_spi_sensor_data(struct device *dev, u16 *val)
goto error_ret; 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: error_ret:
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