mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
rtc: rx8010: use guard
Use guard() to simplify error handling Link: https://patch.msgid.link/20261019211827.126262-16-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
d82730f230
commit
bde8e458f8
|
|
@ -73,11 +73,10 @@ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id)
|
|||
struct rx8010_data *rx8010 = i2c_get_clientdata(client);
|
||||
int flagreg, err;
|
||||
|
||||
rtc_lock(rx8010->rtc);
|
||||
guard(rtc_ops)(rx8010->rtc);
|
||||
|
||||
err = regmap_read(rx8010->regs, RX8010_FLAG, &flagreg);
|
||||
if (err) {
|
||||
rtc_unlock(rx8010->rtc);
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +99,6 @@ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id)
|
|||
}
|
||||
|
||||
err = regmap_write(rx8010->regs, RX8010_FLAG, flagreg);
|
||||
rtc_unlock(rx8010->rtc);
|
||||
return err ? IRQ_NONE : IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user