summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-19 23:06:42 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-25 23:46:17 +0100
commit5923819274c37cf4a3c889a3e08901c51ed9d47d (patch)
treea8e5c1ee0b0a5a4a6c577963caba6d31ddc16d7e /drivers
parentd57949bb3c37fcf149c30f976e66b7f97597bd91 (diff)
downloadlinux-stable-5923819274c37cf4a3c889a3e08901c51ed9d47d.tar.gz
linux-stable-5923819274c37cf4a3c889a3e08901c51ed9d47d.tar.bz2
linux-stable-5923819274c37cf4a3c889a3e08901c51ed9d47d.zip
rtc: ds1307: 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-4-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-ds1307.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 183cf7c01364..cd8e438bc9c4 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -558,11 +558,10 @@ static u8 do_trickle_setup_rx8130(struct ds1307 *ds1307, u32 ohms, bool diode)
static irqreturn_t rx8130_irq(int irq, void *dev_id)
{
struct ds1307 *ds1307 = dev_id;
- struct mutex *lock = &ds1307->rtc->ops_lock;
u8 ctl[3];
int ret;
- mutex_lock(lock);
+ rtc_lock(ds1307->rtc);
/* Read control registers. */
ret = regmap_bulk_read(ds1307->regmap, RX8130_REG_EXTENSION, ctl,
@@ -582,7 +581,7 @@ static irqreturn_t rx8130_irq(int irq, void *dev_id)
rtc_update_irq(ds1307->rtc, 1, RTC_AF | RTC_IRQF);
out:
- mutex_unlock(lock);
+ rtc_unlock(ds1307->rtc);
return IRQ_HANDLED;
}