rtc: stm32: use rtc_lock/rtc_unlock
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 19 Jan 2021 22:06:52 +0000 (23:06 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 25 Jan 2021 22:46:17 +0000 (23:46 +0100)
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-14-alexandre.belloni@bootlin.com
drivers/rtc/rtc-stm32.c

index d774aa18f57a57b2396029f5df58db310e8e886b..75a8924ba12b33094b662458c2290f1a21cd0c4b 100644 (file)
@@ -209,7 +209,7 @@ static irqreturn_t stm32_rtc_alarm_irq(int irq, void *dev_id)
        const struct stm32_rtc_events *evts = &rtc->data->events;
        unsigned int status, cr;
 
-       mutex_lock(&rtc->rtc_dev->ops_lock);
+       rtc_lock(rtc->rtc_dev);
 
        status = readl_relaxed(rtc->base + regs->sr);
        cr = readl_relaxed(rtc->base + regs->cr);
@@ -226,7 +226,7 @@ static irqreturn_t stm32_rtc_alarm_irq(int irq, void *dev_id)
                stm32_rtc_clear_event_flags(rtc, evts->alra);
        }
 
-       mutex_unlock(&rtc->rtc_dev->ops_lock);
+       rtc_unlock(rtc->rtc_dev);
 
        return IRQ_HANDLED;
 }