]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
serial: 8250_uniphier: fix error return code in uniphier_uart_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 4 Jan 2018 07:42:15 +0000 (07:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jan 2018 15:45:17 +0000 (16:45 +0100)
Fix to return a negative error code from the port register error
handling case instead of 0, as done elsewhere in this function.

Fixes: 39be40ce066d ("serial: 8250_uniphier: fix serial port index in private data")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_uniphier.c

index 45ef506293aebb455a667a70bfb26d8609b175e5..28d88ccf5a0c2da6c399141de475f8c741960e60 100644 (file)
@@ -250,12 +250,13 @@ static int uniphier_uart_probe(struct platform_device *pdev)
        up.dl_read = uniphier_serial_dl_read;
        up.dl_write = uniphier_serial_dl_write;
 
-       priv->line = serial8250_register_8250_port(&up);
-       if (priv->line < 0) {
+       ret = serial8250_register_8250_port(&up);
+       if (ret < 0) {
                dev_err(dev, "failed to register 8250 port\n");
                clk_disable_unprepare(priv->clk);
                return ret;
        }
+       priv->line = ret;
 
        platform_set_drvdata(pdev, priv);