[PATCH 17/19] rtc: rx8025: use guard

From: alexandre . belloni

Date: Mon Oct 19 2026 - 17:26:35 EST


From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>

Use guard() to simplify error handling

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

diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index 5eeaa929f3ef..2f2deb59cbee 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -180,10 +180,11 @@ static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
struct rx8025_data *rx8025 = i2c_get_clientdata(client);
int status, xstp;

- rtc_lock(rx8025->rtc);
+ guard(rtc_ops)(rx8025->rtc);
+
status = rx8025_read_reg(client, RX8025_REG_CTRL2);
if (status < 0)
- goto out;
+ return IRQ_HANDLED;

xstp = rx8025_is_osc_stopped(rx8025->model, status);
if (xstp)
@@ -201,13 +202,10 @@ static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
status &= RX8025_BIT_CTRL2_DAFG;
if (rx8025_write_reg(client, RX8025_REG_CTRL1,
rx8025->ctrl1 & ~RX8025_BIT_CTRL1_DALE))
- goto out;
+ return IRQ_HANDLED;
rtc_update_irq(rx8025->rtc, 1, RTC_AF | RTC_IRQF);
}

-out:
- rtc_unlock(rx8025->rtc);
-
return IRQ_HANDLED;
}

--
2.56.0