[PATCH 02/19] rtc: ac100: use guard

From: alexandre . belloni

Date: Mon Oct 19 2026 - 17:18:55 EST


From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>

Use guard() to simplify error handling

Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
---
drivers/rtc/rtc-ac100.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c
index bba7115ff3ad..ee9fdb7fb63b 100644
--- a/drivers/rtc/rtc-ac100.c
+++ b/drivers/rtc/rtc-ac100.c
@@ -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;
}

--
2.56.0