mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: ds1343: use guard
Use guard() to simplify error handling Link: https://patch.msgid.link/20261019211827.126262-7-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
3571eedcfc
commit
0d1e6c4a0c
|
|
@ -312,11 +312,11 @@ static irqreturn_t ds1343_thread(int irq, void *dev_id)
|
|||
unsigned int stat;
|
||||
int res = 0;
|
||||
|
||||
rtc_lock(priv->rtc);
|
||||
guard(rtc_ops)(priv->rtc);
|
||||
|
||||
res = regmap_read(priv->map, DS1343_STATUS_REG, &stat);
|
||||
if (res)
|
||||
goto out;
|
||||
return IRQ_HANDLED;
|
||||
|
||||
if (stat & DS1343_IRQF0) {
|
||||
stat &= ~DS1343_IRQF0;
|
||||
|
|
@ -328,8 +328,6 @@ static irqreturn_t ds1343_thread(int irq, void *dev_id)
|
|||
DS1343_A0IE, 0);
|
||||
}
|
||||
|
||||
out:
|
||||
rtc_unlock(priv->rtc);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user