mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: rx8025: use guard
Use guard() to simplify error handling Link: https://patch.msgid.link/20261019211827.126262-17-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
bde8e458f8
commit
eff3e65cdc
|
|
@ -180,10 +180,11 @@ static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
|
|||
struct rx8025_data *rx8025 = i2c_get_clientdata(client);
|
||||
int status, xstp;
|
||||
|
||||
rtc_lock(rx8025->rtc);
|
||||
guard(rtc_ops)(rx8025->rtc);
|
||||
|
||||
status = rx8025_read_reg(client, RX8025_REG_CTRL2);
|
||||
if (status < 0)
|
||||
goto out;
|
||||
return IRQ_HANDLED;
|
||||
|
||||
xstp = rx8025_is_osc_stopped(rx8025->model, status);
|
||||
if (xstp)
|
||||
|
|
@ -201,13 +202,10 @@ static irqreturn_t rx8025_handle_irq(int irq, void *dev_id)
|
|||
status &= RX8025_BIT_CTRL2_DAFG;
|
||||
if (rx8025_write_reg(client, RX8025_REG_CTRL1,
|
||||
rx8025->ctrl1 & ~RX8025_BIT_CTRL1_DALE))
|
||||
goto out;
|
||||
return IRQ_HANDLED;
|
||||
rtc_update_irq(rx8025->rtc, 1, RTC_AF | RTC_IRQF);
|
||||
}
|
||||
|
||||
out:
|
||||
rtc_unlock(rx8025->rtc);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user