diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2024-01-16 00:22:14 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2024-01-18 00:56:46 +0100 |
commit | b7d450d98b0f9917cac31b39ba459a4aee26c8b1 (patch) | |
tree | 8d1a0e758af9d864049e7c9fafcdd2d4bb6925cb /drivers | |
parent | 590b1d19d73914477cfd9faac7a0d7dcf5b4eb08 (diff) | |
download | lwn-b7d450d98b0f9917cac31b39ba459a4aee26c8b1.tar.gz lwn-b7d450d98b0f9917cac31b39ba459a4aee26c8b1.zip |
rtc: max31335: use regmap_update_bits_check
Simplify the IRQ handler by using regmap_update_bits_check.
Reviewed-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20240115232215.273374-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/rtc-max31335.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-max31335.c b/drivers/rtc/rtc-max31335.c index 2ce23f60a7f3..a38d303d9df4 100644 --- a/drivers/rtc/rtc-max31335.c +++ b/drivers/rtc/rtc-max31335.c @@ -348,18 +348,16 @@ static int max31335_alarm_irq_enable(struct device *dev, unsigned int enabled) static irqreturn_t max31335_handle_irq(int irq, void *dev_id) { struct max31335_data *max31335 = dev_id; - int ret, status; + bool status; + int ret; - ret = regmap_read(max31335->regmap, MAX31335_STATUS1, &status); + ret = regmap_update_bits_check(max31335->regmap, MAX31335_STATUS1, + MAX31335_STATUS1_A1F, 0, &status); if (ret) return IRQ_HANDLED; - if (FIELD_GET(MAX31335_STATUS1_A1F, status)) { - regmap_update_bits(max31335->regmap, MAX31335_STATUS1, - MAX31335_STATUS1_A1F, 0); - + if (status) rtc_update_irq(max31335->rtc, 1, RTC_AF | RTC_IRQF); - } return IRQ_HANDLED; } |