[PATCH 10/19] rtc: hym8563: use guard
From: alexandre . belloni
Date: Mon Oct 19 2026 - 17:24:58 EST
From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
Use guard() to simplify error handling
Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
---
drivers/rtc/rtc-hym8563.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 1d52cc3def02..e3d7ca477e75 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -417,7 +417,7 @@ static irqreturn_t hym8563_irq(int irq, void *dev_id)
struct i2c_client *client = hym8563->client;
int data, ret;
- rtc_lock(hym8563->rtc);
+ guard(rtc_ops)(hym8563->rtc);
/* Clear the alarm flag */
@@ -425,7 +425,7 @@ static irqreturn_t hym8563_irq(int irq, void *dev_id)
if (data < 0) {
dev_err(&client->dev, "%s: error reading i2c data %d\n",
__func__, data);
- goto out;
+ return IRQ_HANDLED;
}
data &= ~HYM8563_CTL2_AF;
@@ -436,8 +436,6 @@ static irqreturn_t hym8563_irq(int irq, void *dev_id)
__func__, ret);
}
-out:
- rtc_unlock(hym8563->rtc);
return IRQ_HANDLED;
}
--
2.56.0