rtc: ds3232: use rtc_lock/rtc_unlock
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 19 Jan 2021 22:06:44 +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-6-alexandre.belloni@bootlin.com
drivers/rtc/rtc-ds3232.c

index 16b89035d1350255109990c3567f222ed1fde54f..535e4a88fbb644023c4094c9380b46190d2ab8af 100644 (file)
@@ -406,11 +406,10 @@ static irqreturn_t ds3232_irq(int irq, void *dev_id)
 {
        struct device *dev = dev_id;
        struct ds3232 *ds3232 = dev_get_drvdata(dev);
-       struct mutex *lock = &ds3232->rtc->ops_lock;
        int ret;
        int stat, control;
 
-       mutex_lock(lock);
+       rtc_lock(ds3232->rtc);
 
        ret = regmap_read(ds3232->regmap, DS3232_REG_SR, &stat);
        if (ret)
@@ -448,7 +447,7 @@ static irqreturn_t ds3232_irq(int irq, void *dev_id)
        }
 
 unlock:
-       mutex_unlock(lock);
+       rtc_unlock(ds3232->rtc);
 
        return IRQ_HANDLED;
 }