iio: dac: stm32-dac-core: make use of regmap_set_bits()
authorTrevor Gamblin <tgamblin@baylibre.com>
Mon, 17 Jun 2024 13:50:00 +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 the mask twice, use
regmap_set_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-20-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/stm32-dac-core.c

index e150ac72915407e1d53b8d429fdda516b19dd862..2d567073996b7971e0ffcf9820aa07bc1c4e7646 100644 (file)
@@ -200,9 +200,8 @@ static int stm32_dac_core_resume(struct device *dev)
 
        if (priv->common.hfsel) {
                /* restore hfsel (maybe lost under low power state) */
-               ret = regmap_update_bits(priv->common.regmap, STM32_DAC_CR,
-                                        STM32H7_DAC_CR_HFSEL,
-                                        STM32H7_DAC_CR_HFSEL);
+               ret = regmap_set_bits(priv->common.regmap, STM32_DAC_CR,
+                                     STM32H7_DAC_CR_HFSEL);
                if (ret)
                        return ret;
        }