Skip to content

Commit

Permalink
tty: serial: mxs-auart: Check the return value from clk_prepare_enable()
Browse files Browse the repository at this point in the history
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Fabio Estevam authored and Greg Kroah-Hartman committed Dec 9, 2013
1 parent 753023d commit 9bbc3dc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/tty/serial/mxs-auart.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,12 @@ static void mxs_auart_reset(struct uart_port *u)

static int mxs_auart_startup(struct uart_port *u)
{
int ret;
struct mxs_auart_port *s = to_auart_port(u);

clk_prepare_enable(s->clk);
ret = clk_prepare_enable(s->clk);
if (ret)
return ret;

writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_CLR);

Expand Down Expand Up @@ -957,7 +960,9 @@ auart_console_setup(struct console *co, char *options)
if (!s)
return -ENODEV;

clk_prepare_enable(s->clk);
ret = clk_prepare_enable(s->clk);
if (ret)
return ret;

if (options)
uart_parse_options(options, &baud, &parity, &bits, &flow);
Expand Down

0 comments on commit 9bbc3dc

Please sign in to comment.