serial: 8250_uniphier: call clk_disable_unprepare() on failure path
diff mbox

Message ID 1437721108-19037-1-git-send-email-yamada.masahiro@socionext.com
State New, archived
Headers show

Commit Message

Masahiro Yamada July 24, 2015, 6:58 a.m. UTC
If serial8250_register_8250_port() fails, disable and unprepare the
clock before exiting.

Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/tty/serial/8250/8250_uniphier.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthias Brugger July 24, 2015, 11:23 a.m. UTC | #1
On Friday, July 24, 2015 03:58:28 PM Masahiro Yamada wrote:
> If serial8250_register_8250_port() fails, disable and unprepare the
> clock before exiting.
> 
> Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

Patch
diff mbox

diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index 7d79425..d11621e 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -218,6 +218,7 @@  static int uniphier_uart_probe(struct platform_device *pdev)
 	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;
 	}