[PATCH 05/19] rtc: ds1305: use guard
From: alexandre . belloni
Date: Mon Oct 19 2026 - 17:19:36 EST
From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
Use guard() to simplify locking
Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
---
drivers/rtc/rtc-ds1305.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c
index d4de401548b4..19a32d3476b5 100644
--- a/drivers/rtc/rtc-ds1305.c
+++ b/drivers/rtc/rtc-ds1305.c
@@ -440,7 +440,7 @@ static void ds1305_work(struct work_struct *work)
int status;
/* lock to protect ds1305->ctrl */
- rtc_lock(ds1305->rtc);
+ guard(rtc_ops)(ds1305->rtc);
/* Disable the IRQ, and clear its status ... for now, we "know"
* that if more than one alarm is active, they're in sync.
@@ -458,8 +458,6 @@ static void ds1305_work(struct work_struct *work)
if (status < 0)
dev_dbg(&spi->dev, "clear irq --> %d\n", status);
- rtc_unlock(ds1305->rtc);
-
if (!test_bit(FLAG_EXITING, &ds1305->flags))
enable_irq(spi->irq);
--
2.56.0