Commit 7defa77d authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

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: 39be40ce ("serial: 8250_uniphier: fix serial port index in private data")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ea3d8465
...@@ -250,12 +250,13 @@ static int uniphier_uart_probe(struct platform_device *pdev) ...@@ -250,12 +250,13 @@ static int uniphier_uart_probe(struct platform_device *pdev)
up.dl_read = uniphier_serial_dl_read; up.dl_read = uniphier_serial_dl_read;
up.dl_write = uniphier_serial_dl_write; up.dl_write = uniphier_serial_dl_write;
priv->line = serial8250_register_8250_port(&up); ret = serial8250_register_8250_port(&up);
if (priv->line < 0) { if (ret < 0) {
dev_err(dev, "failed to register 8250 port\n"); dev_err(dev, "failed to register 8250 port\n");
clk_disable_unprepare(priv->clk); clk_disable_unprepare(priv->clk);
return ret; return ret;
} }
priv->line = ret;
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment