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

rtc: mcp795: 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-9-alexandre.belloni@bootlin.com

+2 -3
+2 -3
drivers/rtc/rtc-mcp795.c
··· 350 350 { 351 351 struct spi_device *spi = data; 352 352 struct rtc_device *rtc = spi_get_drvdata(spi); 353 - struct mutex *lock = &rtc->ops_lock; 354 353 int ret; 355 354 356 - mutex_lock(lock); 355 + rtc_lock(rtc); 357 356 358 357 /* Disable alarm. 359 358 * There is no need to clear ALM0IF (Alarm 0 Interrupt Flag) bit, ··· 364 365 "Failed to disable alarm in IRQ (ret=%d)\n", ret); 365 366 rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF); 366 367 367 - mutex_unlock(lock); 368 + rtc_unlock(rtc); 368 369 369 370 return IRQ_HANDLED; 370 371 }