summaryrefslogtreecommitdiff
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-06-16 00:48:25 +0300
committerJonathan Cameron <jic23@kernel.org>2015-06-21 16:44:32 +0300
commitfdd15f6594f6bc466a01da28ddd2f11bb0e47a9f (patch)
tree843dc75f6eed46cb45c604249d1cef19b03508c8 /drivers/iio/accel
parent825c50dba0139b0322436ddda7d11f043955875e (diff)
downloadlinux-fdd15f6594f6bc466a01da28ddd2f11bb0e47a9f.tar.xz
iio:accel:bmc150-accel: make use of mask definition
BMC150_ACCEL_SLOPE_THRES_MASK was defined some time ago, but its 'magic' value got used instead in bmc150_accel_write_event(). Make use of it for improved readability. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r--drivers/iio/accel/bmc150-accel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c
index 4e70f51c2370..b812728b438e 100644
--- a/drivers/iio/accel/bmc150-accel.c
+++ b/drivers/iio/accel/bmc150-accel.c
@@ -776,7 +776,7 @@ static int bmc150_accel_write_event(struct iio_dev *indio_dev,
switch (info) {
case IIO_EV_INFO_VALUE:
- data->slope_thres = val & 0xFF;
+ data->slope_thres = val & BMC150_ACCEL_SLOPE_THRES_MASK;
break;
case IIO_EV_INFO_PERIOD:
data->slope_dur = val & BMC150_ACCEL_SLOPE_DUR_MASK;