aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mcp795.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-19 23:06:47 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-25 23:46:17 +0100
commitcc9230178410593c2aec28fdd5700915854cd7e3 (patch)
tree96fff9ee56f43a259caf79ecc93f66a3ac8be0f9 /drivers/rtc/rtc-mcp795.c
parent06c6e3216713e7df2a962bbf2b291dff5d2a51d4 (diff)
downloadlinux-cc9230178410593c2aec28fdd5700915854cd7e3.tar.gz
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
Diffstat (limited to 'drivers/rtc/rtc-mcp795.c')
-rw-r--r--drivers/rtc/rtc-mcp795.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-mcp795.c b/drivers/rtc/rtc-mcp795.c
index 21cbf7f892e8d..bad7792b6ca58 100644
--- a/drivers/rtc/rtc-mcp795.c
+++ b/drivers/rtc/rtc-mcp795.c
@@ -350,10 +350,9 @@ static irqreturn_t mcp795_irq(int irq, void *data)
{
struct spi_device *spi = data;
struct rtc_device *rtc = spi_get_drvdata(spi);
- struct mutex *lock = &rtc->ops_lock;
int ret;
- mutex_lock(lock);
+ rtc_lock(rtc);
/* Disable alarm.
* There is no need to clear ALM0IF (Alarm 0 Interrupt Flag) bit,
@@ -365,7 +364,7 @@ static irqreturn_t mcp795_irq(int irq, void *data)
"Failed to disable alarm in IRQ (ret=%d)\n", ret);
rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);
- mutex_unlock(lock);
+ rtc_unlock(rtc);
return IRQ_HANDLED;
}