summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2017-03-08 14:08:59 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-09 11:51:27 +0100
commit6dc7545135c010b3f14061148ffab0874825f471 (patch)
tree8a3dc86e25653109f0a2ccf2e846d78ba42cca98 /drivers/serial
parent3494084017c4b7e6b44923219a9fd07689fcc2fc (diff)
downloadbarebox-6dc7545135c010b3f14061148ffab0874825f471.tar.gz
serial: atmel: Check result of clk_get()
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/atmel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c
index 4e4624e..ab94fd2 100644
--- a/drivers/serial/atmel.c
+++ b/drivers/serial/atmel.c
@@ -403,6 +403,11 @@ static int atmel_serial_init_port(struct console_device *cdev)
return -ENOENT;
uart->clk = clk_get(dev, "usart");
+ if (IS_ERR(uart->clk)) {
+ dev_err(dev, "Failed to get 'usart' clock\n");
+ return PTR_ERR(uart->clk);
+ }
+
clk_enable(uart->clk);
uart->uartclk = clk_get_rate(uart->clk);