Skip to content

Commit 590b1d1

Browse files
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent dedaf03 commit 590b1d1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/rtc/rtc-max31335.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,27 +348,19 @@ static int max31335_alarm_irq_enable(struct device *dev, unsigned int enabled)
348348
static irqreturn_t max31335_handle_irq(int irq, void *dev_id)
349349
{
350350
struct max31335_data *max31335 = dev_id;
351-
struct mutex *lock = &max31335->rtc->ops_lock;
352351
int ret, status;
353352

354-
mutex_lock(lock);
355-
356353
ret = regmap_read(max31335->regmap, MAX31335_STATUS1, &status);
357354
if (ret)
358-
goto exit;
355+
return IRQ_HANDLED;
359356

360357
if (FIELD_GET(MAX31335_STATUS1_A1F, status)) {
361-
ret = regmap_update_bits(max31335->regmap, MAX31335_STATUS1,
362-
MAX31335_STATUS1_A1F, 0);
363-
if (ret)
364-
goto exit;
358+
regmap_update_bits(max31335->regmap, MAX31335_STATUS1,
359+
MAX31335_STATUS1_A1F, 0);
365360

366361
rtc_update_irq(max31335->rtc, 1, RTC_AF | RTC_IRQF);
367362
}
368363

369-
exit:
370-
mutex_unlock(lock);
371-
372364
return IRQ_HANDLED;
373365
}
374366

0 commit comments

Comments
 (0)