The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 1/2] watchdog: orion_wdt: Propagate errors from optional IRQ lookup
@ 2026-08-07  8:04 phucduc.bui
  2026-08-07  8:04 ` [PATCH v2 2/2] watchdog: stm32_iwdg: " phucduc.bui
  0 siblings, 1 reply; 2+ messages in thread
From: phucduc.bui @ 2026-08-07  8:04 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Maxime Coquelin,
	Alexandre Torgue, linux-watchdog
  Cc: linux-kernel, linux-stm32, linux-arm-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

platform_get_irq_optional() returns a positive IRQ number on success or
a negative error code on failure. For an optional IRQ, -ENXIO indicates
that no IRQ is available, while other errors should be propagated.

Propagate errors such as -EPROBE_DEFER and -EINVAL instead of continuing
probe without the IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---

Link v1:
https://lore.kernel.org/all/20260806062812.26523-1-phucduc.bui@gmail.com/
Changes in v2:
 - Update the commit message and error handling.
 - Propagate all errors from platform_get_irq_optional() except -ENXIO,
   instead of only handling -EPROBE_DEFER.

 drivers/watchdog/orion_wdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 0e145f762f6f..f79a14c4e222 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -606,6 +606,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
 
 	/* Request the IRQ only after the watchdog is disabled */
 	irq = platform_get_irq_optional(pdev, 0);
+	if (irq < 0 && irq != -ENXIO)
+		return irq;
 	if (irq > 0) {
 		/*
 		 * Not all supported platforms specify an interrupt for the
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2 2/2] watchdog: stm32_iwdg: Propagate errors from optional IRQ lookup
  2026-08-07  8:04 [PATCH v2 1/2] watchdog: orion_wdt: Propagate errors from optional IRQ lookup phucduc.bui
@ 2026-08-07  8:04 ` phucduc.bui
  0 siblings, 0 replies; 2+ messages in thread
From: phucduc.bui @ 2026-08-07  8:04 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Maxime Coquelin,
	Alexandre Torgue, linux-watchdog
  Cc: linux-kernel, linux-stm32, linux-arm-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

platform_get_irq_optional() returns a positive IRQ number on success or
a negative error code on failure. For an optional IRQ, -ENXIO indicates
that no IRQ is available, while other errors should be propagated.

Propagate errors such as -EPROBE_DEFER and -EINVAL instead of continuing
probe without the IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---

Link v1:
https://lore.kernel.org/all/20260806062812.26523-2-phucduc.bui@gmail.com/
Changes in v2:
 - Update the commit message and error handling.
 - Propagate all errors from platform_get_irq_optional() except -ENXIO,
   instead of only handling -EPROBE_DEFER.

 drivers/watchdog/stm32_iwdg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index b356a272ff9a..a8d2db2d3cf8 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -287,8 +287,11 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
 		return 0;
 
 	irq = platform_get_irq_optional(pdev, 0);
-	if (irq <= 0)
+	if (irq < 0) {
+		if (irq != -ENXIO)
+			return irq;
 		return 0;
+	}
 
 	if (of_property_read_bool(np, "wakeup-source")) {
 		ret = devm_device_init_wakeup(dev);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-07  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  8:04 [PATCH v2 1/2] watchdog: orion_wdt: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-07  8:04 ` [PATCH v2 2/2] watchdog: stm32_iwdg: " phucduc.bui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox