rtc: ds1307: use guard

Use guard() to simplify error handling

Link: https://patch.msgid.link/20261019211827.126262-6-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Alexandre Belloni 2026-10-19 23:18:07 +02:00
parent d1fd5232fa
commit 3571eedcfc

View File

@ -579,28 +579,27 @@ static irqreturn_t rx8130_irq(int irq, void *dev_id)
u8 ctl[3];
int ret;
rtc_lock(ds1307->rtc);
guard(rtc_ops)(ds1307->rtc);
/* Read control registers. */
ret = regmap_bulk_read(ds1307->regmap, RX8130_REG_EXTENSION, ctl,
sizeof(ctl));
if (ret < 0)
goto out;
return IRQ_HANDLED;
if (!(ctl[1] & RX8130_REG_FLAG_AF))
goto out;
return IRQ_HANDLED;
ctl[1] &= ~RX8130_REG_FLAG_AF;
ctl[2] &= ~RX8130_REG_CONTROL0_AIE;
ret = regmap_bulk_write(ds1307->regmap, RX8130_REG_EXTENSION, ctl,
sizeof(ctl));
if (ret < 0)
goto out;
return IRQ_HANDLED;
rtc_update_irq(ds1307->rtc, 1, RTC_AF | RTC_IRQF);
out:
rtc_unlock(ds1307->rtc);
return IRQ_HANDLED;
}