diff options
| author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2026-10-19 23:18:12 +0200 |
|---|---|---|
| committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2026-10-20 14:36:03 +0200 |
| commit | e2005cd977916f52d7dd1d1aa012e7ce3090b271 (patch) | |
| tree | 69a5ec9fc70c4ed1d5c12f41272de6839963934f /drivers | |
| parent | f1104e3e629ae380c881efd534a623e42f31bb88 (diff) | |
rtc: m41t80: use guard
Use guard() to simplify error handling
Link: https://patch.msgid.link/20261019211827.126262-11-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/rtc/rtc-m41t80.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index ec86ca3f2c4c..1385cb43864b 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -162,19 +162,15 @@ static irqreturn_t m41t80_handle_irq(int irq, void *dev_id) unsigned long events = 0; int flags, flags_afe; - rtc_lock(m41t80->rtc); + guard(rtc_ops)(m41t80->rtc); flags_afe = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_MON); - if (flags_afe < 0) { - rtc_unlock(m41t80->rtc); + if (flags_afe < 0) return IRQ_NONE; - } flags = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS); - if (flags <= 0) { - rtc_unlock(m41t80->rtc); + if (flags <= 0) return IRQ_NONE; - } if (flags & M41T80_FLAGS_AF) { flags &= ~M41T80_FLAGS_AF; @@ -189,8 +185,6 @@ static irqreturn_t m41t80_handle_irq(int irq, void *dev_id) flags_afe); } - rtc_unlock(m41t80->rtc); - return IRQ_HANDLED; } |
