[PATCH 07/19] rtc: ds1343: use guard
From: alexandre . belloni
Date: Mon Oct 19 2026 - 17:21:13 EST
From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
Use guard() to simplify error handling
Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
---
drivers/rtc/rtc-ds1343.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c
index 54f6af7886a8..22abec4ba656 100644
--- a/drivers/rtc/rtc-ds1343.c
+++ b/drivers/rtc/rtc-ds1343.c
@@ -312,11 +312,11 @@ static irqreturn_t ds1343_thread(int irq, void *dev_id)
unsigned int stat;
int res = 0;
- rtc_lock(priv->rtc);
+ guard(rtc_ops)(priv->rtc);
res = regmap_read(priv->map, DS1343_STATUS_REG, &stat);
if (res)
- goto out;
+ return IRQ_HANDLED;
if (stat & DS1343_IRQF0) {
stat &= ~DS1343_IRQF0;
@@ -328,8 +328,6 @@ static irqreturn_t ds1343_thread(int irq, void *dev_id)
DS1343_A0IE, 0);
}
-out:
- rtc_unlock(priv->rtc);
return IRQ_HANDLED;
}
--
2.56.0