mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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
This commit is contained in:
@@ -350,10 +350,9 @@ static irqreturn_t mcp795_irq(int irq, void *data)
|
|||||||
{
|
{
|
||||||
struct spi_device *spi = data;
|
struct spi_device *spi = data;
|
||||||
struct rtc_device *rtc = spi_get_drvdata(spi);
|
struct rtc_device *rtc = spi_get_drvdata(spi);
|
||||||
struct mutex *lock = &rtc->ops_lock;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(lock);
|
rtc_lock(rtc);
|
||||||
|
|
||||||
/* Disable alarm.
|
/* Disable alarm.
|
||||||
* There is no need to clear ALM0IF (Alarm 0 Interrupt Flag) bit,
|
* 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);
|
"Failed to disable alarm in IRQ (ret=%d)\n", ret);
|
||||||
rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);
|
rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);
|
||||||
|
|
||||||
mutex_unlock(lock);
|
rtc_unlock(rtc);
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user