[PATCH 2/2] watchdog: stm32_iwdg: Propagate -EPROBE_DEFER from IRQ lookup

From: phucduc . bui

Date: Thu Aug 06 2026 - 02:28:58 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

platform_get_irq_optional() does not returns 0. It returns a positive
IRQ number on success or a negative error code on failure.

Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
re-probed when the interrupt resource becomes available instead of
continuing probe without an IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/watchdog/stm32_iwdg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index b356a272ff9a..102f51084957 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -287,7 +287,9 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
return 0;

irq = platform_get_irq_optional(pdev, 0);
- if (irq <= 0)
+ if (irq == -EPROBE_DEFER)
+ return irq;
+ if (irq < 0)
return 0;

if (of_property_read_bool(np, "wakeup-source")) {
--
2.43.0