Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: ds1305: use rtc_lock/rtc_unlock

Avoid accessing directly rtc->ops_lock and use the RTC core helpers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210119220653.677750-3-alexandre.belloni@bootlin.com

+2 -3
+2 -3
drivers/rtc/rtc-ds1305.c
··· 435 435 static void ds1305_work(struct work_struct *work) 436 436 { 437 437 struct ds1305 *ds1305 = container_of(work, struct ds1305, work); 438 - struct mutex *lock = &ds1305->rtc->ops_lock; 439 438 struct spi_device *spi = ds1305->spi; 440 439 u8 buf[3]; 441 440 int status; 442 441 443 442 /* lock to protect ds1305->ctrl */ 444 - mutex_lock(lock); 443 + rtc_lock(ds1305->rtc); 445 444 446 445 /* Disable the IRQ, and clear its status ... for now, we "know" 447 446 * that if more than one alarm is active, they're in sync. ··· 458 459 if (status < 0) 459 460 dev_dbg(&spi->dev, "clear irq --> %d\n", status); 460 461 461 - mutex_unlock(lock); 462 + rtc_unlock(ds1305->rtc); 462 463 463 464 if (!test_bit(FLAG_EXITING, &ds1305->flags)) 464 465 enable_irq(spi->irq);