diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2018-08-23 23:30:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-18 16:07:24 +0200 |
commit | 2843cbb5d3c467a85112f004a8a9345370760520 (patch) | |
tree | 200a9bfe9e37ae0a9e3c469f163e406da1e04c80 /drivers/tty | |
parent | 5963e8a3122471cadfe0eba41c4ceaeaa5c8bb4d (diff) | |
download | linux-stable-2843cbb5d3c467a85112f004a8a9345370760520.tar.gz linux-stable-2843cbb5d3c467a85112f004a8a9345370760520.tar.bz2 linux-stable-2843cbb5d3c467a85112f004a8a9345370760520.zip |
tty: serial: qcom_geni_serial: Drop useless check for dev.of_node
With gcc 4.1.2:
drivers/tty/serial/qcom_geni_serial.c: In function ‘qcom_geni_serial_probe’:
drivers/tty/serial/qcom_geni_serial.c:1261: warning: ‘drv’ may be used uninitialized in this function
Indeed, if dev.of_node is NULL, drv will be used uninitialized, and
dereferenced in uart_add_one_port(). However, as this driver supports
DT only, dev.of_node will always be valid.
Hence remove the useless check for dev.of_node, killing the warning as a
side effect.
Fixes: 8a8a66a1a18a1dbd ("tty: serial: qcom_geni_serial: Add support for flow control")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/qcom_geni_serial.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 29ec34387246..1cfbb6745a8c 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1263,14 +1263,12 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) if (of_device_is_compatible(pdev->dev.of_node, "qcom,geni-debug-uart")) console = true; - if (pdev->dev.of_node) { - if (console) { - drv = &qcom_geni_console_driver; - line = of_alias_get_id(pdev->dev.of_node, "serial"); - } else { - drv = &qcom_geni_uart_driver; - line = of_alias_get_id(pdev->dev.of_node, "hsuart"); - } + if (console) { + drv = &qcom_geni_console_driver; + line = of_alias_get_id(pdev->dev.of_node, "serial"); + } else { + drv = &qcom_geni_uart_driver; + line = of_alias_get_id(pdev->dev.of_node, "hsuart"); } port = get_port_from_line(line, console); |