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>
This commit is contained in:
Fabio Estevam 2016-09-09 08:31:33 -03:00 committed by Greg Kroah-Hartman
parent 8b2303de39
commit 5d7519dfc9
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}
/*