[PATCH 2/3] tty: serial: imx: Propagate errors from optional IRQ lookup
phucduc.bui at gmail.com
phucduc.bui at gmail.com
Fri Aug 7 02:09:44 PDT 2026
From: bui duc phuc <phucduc.bui at 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 at gmail.com>
---
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
More information about the linux-arm-kernel
mailing list