summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-09-12 19:24:24 +0800
committerSascha Hauer <s.hauer@pengutronix.de>2010-09-20 08:56:42 +0200
commit3c605668b497648a98ad894119442776f7152fd1 (patch)
tree3dda6019a37151f2adabfac69ea1849798c03f29
parentc33a2e503c32696bbf5f2388599cabc5d4d45c01 (diff)
downloadbarebox-3c605668b497648a98ad894119442776f7152fd1.tar.gz
barebox-3c605668b497648a98ad894119442776f7152fd1.tar.xz
amba-pl011: probe fail if we can't get the clock
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-rw-r--r--drivers/serial/amba-pl011.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 07508d03b0..bc9b0def8e 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -34,6 +34,7 @@
#include <asm/io.h>
#include <linux/amba/serial.h>
#include <linux/clk.h>
+#include <linux/err.h>
/*
* We wrap our port structure around the generic console_device.
@@ -160,6 +161,9 @@ static int pl011_probe(struct device_d *dev)
uart->clk = clk_get(dev, NULL);
+ if (IS_ERR(uart->clk))
+ return PTR_ERR(uart->clk);
+
cdev = &uart->uart;
dev->type_data = cdev;
cdev->dev = dev;