summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-09-09 08:31:33 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-13 18:54:34 +0200
commit5d7519dfc963ec8b6a10a51356840580fc005a1e (patch)
treef4e90974c11ba3d92c5ffa1f2263aee61b1f3043 /drivers/tty
parent8b2303de399f66b0da2c7e5bcc8296be574766f1 (diff)
downloadop-kernel-dev-5d7519dfc963ec8b6a10a51356840580fc005a1e.zip
op-kernel-dev-5d7519dfc963ec8b6a10a51356840580fc005a1e.tar.gz
serial: mxs-auart: Disable clock on error path
We should disable the previously acquired clock when enabling s->clk fails. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mxs-auart.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 2f04ec2..680270b 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1543,10 +1543,14 @@ static int mxs_get_clks(struct mxs_auart_port *s,
err = clk_prepare_enable(s->clk);
if (err) {
dev_err(s->dev, "Failed to enable clk!\n");
- return err;
+ goto disable_clk_ahb;
}
return 0;
+
+disable_clk_ahb:
+ clk_disable_unprepare(s->clk_ahb);
+ return err;
}
/*
OpenPOWER on IntegriCloud