tty: serial: mxs-auart: Check the return value from clk_prepare_enable()
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 2 Dec 2013 03:17:58 +0000 (01:17 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2013 01:14:58 +0000 (17:14 -0800)
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>
drivers/tty/serial/mxs-auart.c

index d8b6fee77a039220ae8d7d8f08a9ff8e08c7066f..aa97fd845b4d8123102c6026ed9a79e53d61e45f 100644 (file)
@@ -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);
 
@@ -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);
This page took 0.026958 seconds and 5 git commands to generate.