[PATCH 3/3] serial: 8250_mtk: Propagate errors from optional IRQ lookup

From: phucduc . bui

Date: Fri Aug 07 2026 - 05:10:31 EST


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

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@xxxxxxxxx>
---
drivers/tty/serial/8250/8250_mtk.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index e6a56cf54ae0..d0d2aecf9005 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -587,6 +587,8 @@ static int mtk8250_probe(struct platform_device *pdev)
return data->line;

data->rx_wakeup_irq = platform_get_irq_optional(pdev, 1);
+ if (data->rx_wakeup_irq < 0 && data->rx_wakeup_irq != -ENXIO)
+ return data->rx_wakeup_irq;

pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
--
2.43.0