[PATCH v9 04/11] iio: accel: adxl345: simplify interrupt mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace mapping all sensor interrupts to the corresponding interrupt
line using regmap_assign_bits() since it takes a boolean directly.
Further prefer the units.h identifier to cover the full register when bits
are set.

This is a refactoring change and should not impact functionality.

Signed-off-by: Lothar Rubusch <l.rubusch@xxxxxxxxx>
---
 drivers/iio/accel/adxl345_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c
index cae9e37e216f..18c625d323ba 100644
--- a/drivers/iio/accel/adxl345_core.c
+++ b/drivers/iio/accel/adxl345_core.c
@@ -1216,9 +1216,8 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap,
 		 * interrupts to the INT1 pin, whereas bits set to 1 send their respective
 		 * interrupts to the INT2 pin. The intio shall convert this accordingly.
 		 */
-		regval = intio ? 0xff : 0;
-
-		ret = regmap_write(st->regmap, ADXL345_REG_INT_MAP, regval);
+		ret = regmap_assign_bits(st->regmap, ADXL345_REG_INT_MAP,
+					 U8_MAX, intio);
 		if (ret)
 			return ret;
 
-- 
2.39.5





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux