diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2016-09-09 08:31:33 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-13 18:54:34 +0200 |
commit | 5d7519dfc963ec8b6a10a51356840580fc005a1e (patch) | |
tree | f4e90974c11ba3d92c5ffa1f2263aee61b1f3043 /drivers/tty | |
parent | 8b2303de399f66b0da2c7e5bcc8296be574766f1 (diff) | |
download | linux-5d7519dfc963ec8b6a10a51356840580fc005a1e.tar.bz2 |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 2f04ec2b5691..680270b85ff7 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; } /* |