[PATCH 2/3] tty: serial: imx: Propagate errors from optional IRQ lookup

From: phucduc . bui

Date: Fri Aug 07 2026 - 05:10:19 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/imx.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 251a50c8aa38..4224454d360e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2463,7 +2463,11 @@ static int imx_uart_probe(struct platform_device *pdev)
if (rxirq < 0)
return rxirq;
txirq = platform_get_irq_optional(pdev, 1);
+ if (txirq < 0 && txirq != -ENXIO)
+ return txirq;
rtsirq = platform_get_irq_optional(pdev, 2);
+ if (rtsirq < 0 && rtsirq != -ENXIO)
+ return rtsirq;

sport->port.dev = &pdev->dev;
sport->port.mapbase = res->start;
--
2.43.0