mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: ac100: use guard
Use guard() to simplify error handling Link: https://patch.msgid.link/20261019211827.126262-2-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
ae8b3e1008
commit
f49ca91f8a
|
|
@ -529,12 +529,12 @@ static irqreturn_t ac100_rtc_irq(int irq, void *data)
|
|||
unsigned int val = 0;
|
||||
int ret;
|
||||
|
||||
rtc_lock(chip->rtc);
|
||||
guard(rtc_ops)(chip->rtc);
|
||||
|
||||
/* read status */
|
||||
ret = regmap_read(regmap, AC100_ALM_INT_STA, &val);
|
||||
if (ret)
|
||||
goto out;
|
||||
return IRQ_HANDLED;
|
||||
|
||||
if (val & AC100_ALM_INT_ENABLE) {
|
||||
/* signal rtc framework */
|
||||
|
|
@ -543,16 +543,14 @@ static irqreturn_t ac100_rtc_irq(int irq, void *data)
|
|||
/* clear status */
|
||||
ret = regmap_write(regmap, AC100_ALM_INT_STA, val);
|
||||
if (ret)
|
||||
goto out;
|
||||
return IRQ_HANDLED;
|
||||
|
||||
/* disable interrupt */
|
||||
ret = ac100_rtc_alarm_irq_enable(chip->dev, 0);
|
||||
if (ret)
|
||||
goto out;
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
out:
|
||||
rtc_unlock(chip->rtc);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user