mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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>
This commit is contained in:
parent
f1104e3e62
commit
e2005cd977
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user