mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
watchdog: orion_wdt: 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/20260810082606.42623-1-phucduc.bui@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
2bab791e56
commit
3bbbeb7fdd
|
|
@ -606,6 +606,10 @@ 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) {
|
||||
ret = irq;
|
||||
goto disable_clk;
|
||||
}
|
||||
if (irq > 0) {
|
||||
/*
|
||||
* Not all supported platforms specify an interrupt for the
|
||||
|
|
@ -619,6 +623,10 @@ static int orion_wdt_probe(struct platform_device *pdev)
|
|||
|
||||
/* Optional 2nd interrupt for pretimeout */
|
||||
irq = platform_get_irq_optional(pdev, 1);
|
||||
if (irq < 0 && irq != -ENXIO) {
|
||||
ret = irq;
|
||||
goto disable_clk;
|
||||
}
|
||||
if (irq > 0) {
|
||||
orion_wdt_info.options |= WDIOF_PRETIMEOUT;
|
||||
ret = devm_request_irq(&pdev->dev, irq, orion_wdt_pre_irq,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user