mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
rtc: ds1685: 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> Acked-by: Joshua Kinard <kumba@gentoo.org> Link: https://lore.kernel.org/r/20210119220653.677750-5-alexandre.belloni@bootlin.com
This commit is contained in:
@@ -658,7 +658,6 @@ ds1685_rtc_irq_handler(int irq, void *dev_id)
|
|||||||
{
|
{
|
||||||
struct platform_device *pdev = dev_id;
|
struct platform_device *pdev = dev_id;
|
||||||
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
|
||||||
struct mutex *rtc_mutex;
|
|
||||||
u8 ctrlb, ctrlc;
|
u8 ctrlb, ctrlc;
|
||||||
unsigned long events = 0;
|
unsigned long events = 0;
|
||||||
u8 num_irqs = 0;
|
u8 num_irqs = 0;
|
||||||
@@ -667,8 +666,7 @@ ds1685_rtc_irq_handler(int irq, void *dev_id)
|
|||||||
if (unlikely(!rtc))
|
if (unlikely(!rtc))
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
|
|
||||||
rtc_mutex = &rtc->dev->ops_lock;
|
rtc_lock(rtc->dev);
|
||||||
mutex_lock(rtc_mutex);
|
|
||||||
|
|
||||||
/* Ctrlb holds the interrupt-enable bits and ctrlc the flag bits. */
|
/* Ctrlb holds the interrupt-enable bits and ctrlc the flag bits. */
|
||||||
ctrlb = rtc->read(rtc, RTC_CTRL_B);
|
ctrlb = rtc->read(rtc, RTC_CTRL_B);
|
||||||
@@ -713,7 +711,7 @@ ds1685_rtc_irq_handler(int irq, void *dev_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
rtc_update_irq(rtc->dev, num_irqs, events);
|
rtc_update_irq(rtc->dev, num_irqs, events);
|
||||||
mutex_unlock(rtc_mutex);
|
rtc_unlock(rtc->dev);
|
||||||
|
|
||||||
return events ? IRQ_HANDLED : IRQ_NONE;
|
return events ? IRQ_HANDLED : IRQ_NONE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user