mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
watchdog: stm32_iwdg: Propagate errors from optional IRQ lookup
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: https://lore.kernel.org/r/20260807080447.35479-2-phucduc.bui@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
committed by
Guenter Roeck
parent
ac4bf51d4d
commit
553edb793e
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user