iio: gyro: bmg160_core: make use of regmap_clear_bits()
authorTrevor Gamblin <tgamblin@baylibre.com>
Mon, 17 Jun 2024 13:50:01 +0000 (09:50 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 25 Jun 2024 20:04:46 +0000 (21:04 +0100)
Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().

Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20240617-review-v3-21-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/gyro/bmg160_core.c

index 0e2eb0e98235f547d4c7206ec59ea2a013f23f09..10728d5ccae398d15c1d51e0380306042675d5c0 100644 (file)
@@ -285,8 +285,8 @@ static int bmg160_chip_init(struct bmg160_data *data)
        data->slope_thres = val;
 
        /* Set default interrupt mode */
-       ret = regmap_update_bits(data->regmap, BMG160_REG_INT_EN_1,
-                                BMG160_INT1_BIT_OD, 0);
+       ret = regmap_clear_bits(data->regmap, BMG160_REG_INT_EN_1,
+                               BMG160_INT1_BIT_OD);
        if (ret < 0) {
                dev_err(dev, "Error updating bits in reg_int_en_1\n");
                return ret;