diff options
| author | Aniket Randive <aniket.randive@oss.qualcomm.com> | 2026-05-04 15:40:45 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-05-11 17:21:12 +0200 |
| commit | 16e95bfb79b5d9d01dc7651d98caf3c2ace331cd (patch) | |
| tree | c34ed47015ce2581718b88dd8735183cd20f5456 /drivers/tty | |
| parent | ebd57bda9df6234d93e05dfe2fd250c6535ca3bb (diff) | |
serial: qcom-geni: Avoid probing debug console UART without console support
When CONFIG_SERIAL_QCOM_GENI_CONSOLE is disabled, the driver still
advertises the debug UART compatible strings ("qcom,geni-debug-uart"
and "qcom,sa8255p-geni-debug-uart") in its of_match table. This lets the
driver match and probe console UART DT nodes even though console
support is not built. As a result, the console port is never registered
with the UART core and uart_add_one_port() fails with -EINVAL.
Fix this by only including the debug UART compatible entries in the
match table when CONFIG_SERIAL_QCOM_GENI_CONSOLE is enabled, preventing
the driver from probing console UART nodes when console support is
absent.
Reviewed-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com>
Link: https://patch.msgid.link/20260504101045.1084672-1-aniket.randive@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
| -rw-r--r-- | drivers/tty/serial/qcom_geni_serial.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index b365dd5da3cb..58d142afa160 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1992,6 +1992,7 @@ static int qcom_geni_serial_resume(struct device *dev) return ret; } +#if IS_ENABLED(CONFIG_SERIAL_QCOM_GENI_CONSOLE) static const struct qcom_geni_device_data qcom_geni_console_data = { .console = true, .mode = GENI_SE_FIFO, @@ -2000,14 +2001,6 @@ static const struct qcom_geni_device_data qcom_geni_console_data = { .power_state = geni_serial_resource_state, }; -static const struct qcom_geni_device_data qcom_geni_uart_data = { - .console = false, - .mode = GENI_SE_DMA, - .resources_init = geni_serial_resource_init, - .set_rate = geni_serial_set_rate, - .power_state = geni_serial_resource_state, -}; - static const struct qcom_geni_device_data sa8255p_qcom_geni_console_data = { .console = true, .mode = GENI_SE_FIFO, @@ -2019,6 +2012,15 @@ static const struct qcom_geni_device_data sa8255p_qcom_geni_console_data = { .resources_init = geni_serial_pwr_init, .set_rate = geni_serial_set_level, }; +#endif + +static const struct qcom_geni_device_data qcom_geni_uart_data = { + .console = false, + .mode = GENI_SE_DMA, + .resources_init = geni_serial_resource_init, + .set_rate = geni_serial_set_rate, + .power_state = geni_serial_resource_state, +}; static const struct qcom_geni_device_data sa8255p_qcom_geni_uart_data = { .console = false, @@ -2039,6 +2041,7 @@ static const struct dev_pm_ops qcom_geni_serial_pm_ops = { }; static const struct of_device_id qcom_geni_serial_match_table[] = { +#if IS_ENABLED(CONFIG_SERIAL_QCOM_GENI_CONSOLE) { .compatible = "qcom,geni-debug-uart", .data = &qcom_geni_console_data, @@ -2047,6 +2050,7 @@ static const struct of_device_id qcom_geni_serial_match_table[] = { .compatible = "qcom,sa8255p-geni-debug-uart", .data = &sa8255p_qcom_geni_console_data, }, +#endif { .compatible = "qcom,geni-uart", .data = &qcom_geni_uart_data, |
