diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-01-04 07:42:15 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 16:45:17 +0100 |
commit | 7defa77d2baca4d6eb85234f10f38ab618332e75 (patch) | |
tree | 1769ce6782d6026a0dd865d25874545762a62144 | |
parent | ea3d8465ab9b3e01be329ac5195970a84bef76c5 (diff) | |
download | linux-stable-7defa77d2baca4d6eb85234f10f38ab618332e75.tar.gz linux-stable-7defa77d2baca4d6eb85234f10f38ab618332e75.tar.bz2 linux-stable-7defa77d2baca4d6eb85234f10f38ab618332e75.zip |
serial: 8250_uniphier: fix error return code in uniphier_uart_probe()
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>
-rw-r--r-- | drivers/tty/serial/8250/8250_uniphier.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index 45ef506293ae..28d88ccf5a0c 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -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); |