aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-max31335.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2024-01-16 00:22:13 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2024-01-18 00:56:46 +0100
commit590b1d19d73914477cfd9faac7a0d7dcf5b4eb08 (patch)
tree55140fe4ff2055ec2e70a5a99f8fc0240cde06ea /drivers/rtc/rtc-max31335.c
parentdedaf03b99d6561fae06457fd7fc2b0aa154d003 (diff)
downloadlinux-590b1d19d73914477cfd9faac7a0d7dcf5b4eb08.tar.gz
rtc: max31335: remove unecessary locking
There is no race condition when accessing MAX31335_STATUS1 because it is always about clearing the alarm interrupt bit. Reviewed-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Link: https://lore.kernel.org/r/20240115232215.273374-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-max31335.c')
-rw-r--r--drivers/rtc/rtc-max31335.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-max31335.c b/drivers/rtc/rtc-max31335.c
index 3ddfe71bbb560..2ce23f60a7f34 100644
--- a/drivers/rtc/rtc-max31335.c
+++ b/drivers/rtc/rtc-max31335.c
@@ -348,27 +348,19 @@ static int max31335_alarm_irq_enable(struct device *dev, unsigned int enabled)
static irqreturn_t max31335_handle_irq(int irq, void *dev_id)
{
struct max31335_data *max31335 = dev_id;
- struct mutex *lock = &max31335->rtc->ops_lock;
int ret, status;
- mutex_lock(lock);
-
ret = regmap_read(max31335->regmap, MAX31335_STATUS1, &status);
if (ret)
- goto exit;
+ return IRQ_HANDLED;
if (FIELD_GET(MAX31335_STATUS1_A1F, status)) {
- ret = regmap_update_bits(max31335->regmap, MAX31335_STATUS1,
- MAX31335_STATUS1_A1F, 0);
- if (ret)
- goto exit;
+ regmap_update_bits(max31335->regmap, MAX31335_STATUS1,
+ MAX31335_STATUS1_A1F, 0);
rtc_update_irq(max31335->rtc, 1, RTC_AF | RTC_IRQF);
}
-exit:
- mutex_unlock(lock);
-
return IRQ_HANDLED;
}