diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-12-01 22:17:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-08 20:14:58 -0500 |
commit | 9bbc3dca9d2212f900396ab9642c48279657a8c0 (patch) | |
tree | 39490e44fb46380d78d13223a70640a800b59988 /drivers | |
parent | 753023dcdd2da515f991aa0e6a65016713f0c24f (diff) |
tty: serial: mxs-auart: Check the return value from clk_prepare_enable()
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/mxs-auart.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index d8b6fee77a03..aa97fd845b4d 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c | |||
@@ -734,9 +734,12 @@ static void mxs_auart_reset(struct uart_port *u) | |||
734 | 734 | ||
735 | static int mxs_auart_startup(struct uart_port *u) | 735 | static int mxs_auart_startup(struct uart_port *u) |
736 | { | 736 | { |
737 | int ret; | ||
737 | struct mxs_auart_port *s = to_auart_port(u); | 738 | struct mxs_auart_port *s = to_auart_port(u); |
738 | 739 | ||
739 | clk_prepare_enable(s->clk); | 740 | ret = clk_prepare_enable(s->clk); |
741 | if (ret) | ||
742 | return ret; | ||
740 | 743 | ||
741 | writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_CLR); | 744 | writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_CLR); |
742 | 745 | ||
@@ -957,7 +960,9 @@ auart_console_setup(struct console *co, char *options) | |||
957 | if (!s) | 960 | if (!s) |
958 | return -ENODEV; | 961 | return -ENODEV; |
959 | 962 | ||
960 | clk_prepare_enable(s->clk); | 963 | ret = clk_prepare_enable(s->clk); |
964 | if (ret) | ||
965 | return ret; | ||
961 | 966 | ||
962 | if (options) | 967 | if (options) |
963 | uart_parse_options(options, &baud, &parity, &bits, &flow); | 968 | uart_parse_options(options, &baud, &parity, &bits, &flow); |