[PATCH 1/2] rtc: isl1208: Fix returning errno as irqreturn_t in IRQ handler
From: John Madieu
Date: Sat Apr 25 2026 - 11:51:54 EST
isl1208_rtc_interrupt() is of irqreturn_t type but two paths
return a negative i2c errno instead of an IRQ_* value:
- The SR-poll loop on timeout: `return sr;`
- The post-alarm cleanup path: `return err;`
genirq's note_interrupt() casts the return to unsigned int and
flags any value above IRQ_HANDLED|IRQ_WAKE_THREAD as a bogus
return, logging "irq event N: bogus return value X" each time it
happens.
Return IRQ_NONE when the SR read failed (no progress, can't claim
the interrupt) and IRQ_HANDLED when toggle_alarm failed.
Fixes: cf044f0ed526 ("drivers/rtc/rtc-isl1208.c: add alarm support")
Signed-off-by: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
---
drivers/rtc/rtc-isl1208.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index f71a6bb77b2a..c93998c53e7a 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -654,7 +654,7 @@ isl1208_rtc_interrupt(int irq, void *data)
if (time_after(jiffies, timeout)) {
dev_err(&client->dev, "%s: reading SR failed\n",
__func__);
- return sr;
+ return IRQ_NONE;
}
}
@@ -666,7 +666,7 @@ isl1208_rtc_interrupt(int irq, void *data)
/* Disable the alarm */
err = isl1208_rtc_toggle_alarm(client, 0);
if (err)
- return err;
+ return IRQ_HANDLED;
fsleep(275);
--
2.25.1