serial: qcom-geni: 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>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260807090945.41690-1-phucduc.bui@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
bui duc phuc 2026-08-07 16:09:43 +07:00 committed by Greg Kroah-Hartman
parent 041a275af5
commit 456ce32b60

View File

@ -1947,8 +1947,13 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
uport->irq = irq;
uport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_QCOM_GENI_CONSOLE);
if (!data->console)
if (!data->console) {
port->wakeup_irq = platform_get_irq_optional(pdev, 1);
if (port->wakeup_irq < 0 && port->wakeup_irq != -ENXIO) {
ret = port->wakeup_irq;
goto error;
}
}
if (of_property_read_bool(pdev->dev.of_node, "rx-tx-swap"))
port->rx_tx_swap = true;