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 <alexandre.belloni@bootlin.com>
This commit is contained in:
Alexandre Belloni 2026-10-19 23:18:06 +02:00
parent f371caa420
commit d1fd5232fa

View File

@ -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);