From d1fd5232fadcdd59ac4cd5fc0d122da2f1f56048 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Mon, 19 Oct 2026 23:18:06 +0200 Subject: [PATCH] rtc: ds1305: use guard Use guard() to simplify locking Link: https://patch.msgid.link/20261019211827.126262-5-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni --- 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);