summary refs log tree commit diff
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-08-31 12:08:12 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-09-03 19:41:00 +0100
commit2b09b41dba04092fc198a5098908345f756db160 (patch)
tree4b51875ce7d46fbb937368f0b99ca9360aa705a4 /drivers/iio/accel
parentdf9f7d4c330d1ca3e124d73a137a7df32ca3ac33 (diff)
downloadlinux-2b09b41dba04092fc198a5098908345f756db160.tar.gz
iio: accel: bma220: Use BIT() and GENMASK() macros
Code is better to read when numbers of bit are explicitly used.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r--drivers/iio/accel/bma220_spi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c
index 73927f9c9b01..efdf22e0a23a 100644
--- a/drivers/iio/accel/bma220_spi.c
+++ b/drivers/iio/accel/bma220_spi.c
@@ -5,6 +5,7 @@
  * Copyright (c) 2016, Intel Corporation.
  */
 
+#include <linux/bits.h>
 #include <linux/kernel.h>
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
@@ -24,8 +25,8 @@
 #define BMA220_REG_SUSPEND			0x18
 
 #define BMA220_CHIP_ID				0xDD
-#define BMA220_READ_MASK			0x80
-#define BMA220_RANGE_MASK			0x03
+#define BMA220_READ_MASK			BIT(7)
+#define BMA220_RANGE_MASK			GENMASK(1, 0)
 #define BMA220_DATA_SHIFT			2
 #define BMA220_SUSPEND_SLEEP			0xFF
 #define BMA220_SUSPEND_WAKE			0x00