summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/resolver
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-09 08:13:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-09 08:13:01 +0100
commit355a73f07d1da405728c9e57afd6eede340788f4 (patch)
treebca9d993a19c9cf0940231323ad74fbec605b044 /drivers/staging/iio/resolver
parent197f4d6a4a00915b29fa7ec71f8010b9c763e676 (diff)
parent9eccca0843205f87c00404b663188b88eb248051 (diff)
Merge 4.0-rc3 into staging-next
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/resolver')
-rw-r--r--drivers/staging/iio/resolver/ad2s1200.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c
index 017d2f8379b7..c17893b4918c 100644
--- a/drivers/staging/iio/resolver/ad2s1200.c
+++ b/drivers/staging/iio/resolver/ad2s1200.c
@@ -18,6 +18,7 @@
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/module.h>
+#include <linux/bitops.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
@@ -68,7 +69,7 @@ static int ad2s1200_read_raw(struct iio_dev *indio_dev,
break;
case IIO_ANGL_VEL:
vel = (((s16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4);
- vel = (vel << 4) >> 4;
+ vel = sign_extend32(vel, 11);
*val = vel;
break;
default: