summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-04-25 15:10:44 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-29 16:20:24 +0200
commit74cdf8cec7dd4c9c06533555a49b4afb429cb5be (patch)
treef37fedd203f93102e6ca4b33dc6707f75b7b07ae /drivers/tty
parent8ef795653d753e3d6ae67e6f4a0168ff3c059deb (diff)
downloadlinux-74cdf8cec7dd4c9c06533555a49b4afb429cb5be.tar.bz2
serial: milbeaut_usio: Fix error handling in probe and remove
devm_clk_get() is used so there is no reason to explicitly call clk_put() in probe or remove functions. Also remove duplicate assign for port->membase. Fixes: ba44dc043004 ("serial: Add Milbeaut serial control") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Tested-by: Sugaya Taichi <sugaya.taichi@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/milbeaut_usio.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c
index 4a10604211be..949ab7efc4fc 100644
--- a/drivers/tty/serial/milbeaut_usio.c
+++ b/drivers/tty/serial/milbeaut_usio.c
@@ -525,8 +525,6 @@ static int mlb_usio_probe(struct platform_device *pdev)
ret = -ENODEV;
goto failed;
}
- port->mapbase = res->start;
- port->membase = ioremap(res->start, (res->end - res->start + 1));
port->membase = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
@@ -548,16 +546,12 @@ static int mlb_usio_probe(struct platform_device *pdev)
ret = uart_add_one_port(&mlb_usio_uart_driver, port);
if (ret) {
dev_err(&pdev->dev, "Adding port failed: %d\n", ret);
- goto failed1;
+ goto failed;
}
return 0;
-failed1:
- iounmap(port->membase);
-
failed:
clk_disable_unprepare(clk);
- clk_put(clk);
return ret;
}
@@ -569,7 +563,6 @@ static int mlb_usio_remove(struct platform_device *pdev)
uart_remove_one_port(&mlb_usio_uart_driver, port);
clk_disable_unprepare(clk);
- clk_put(clk);
return 0;
}