[PATCH 2/4] macb: handle clk_get error

Hubert Feurstein h.feurstein at gmail.com
Fri Sep 9 07:46:47 EDT 2011


Signed-off-by: Hubert Feurstein <h.feurstein at gmail.com>
---
 drivers/net/macb.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 9e5ce8b..ebe3bd4 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -49,6 +49,7 @@
 #include <asm/io.h>
 #include <mach/board.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include "macb.h"
 
@@ -454,6 +455,11 @@ static int macb_probe(struct device_d *dev)
 	 */
 #if defined(CONFIG_ARCH_AT91)
 	pclk = clk_get(dev, "macb_clk");
+	if (IS_ERR(pclk)) {
+		dev_err(dev, "no macb_clk\n");
+		return PTR_ERR(pclk);
+	}
+
 	clk_enable(pclk);
 	macb_hz = clk_get_rate(pclk);
 #else
-- 
1.7.4.1




More information about the barebox mailing list