[PATCH 3/4] atmel_mci: handle clk_get error correctly

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


Signed-off-by: Hubert Feurstein <h.feurstein at gmail.com>
---
 drivers/mci/atmel_mci.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index b4489dd..943ab34 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -23,6 +23,7 @@
 #include <asm/io.h>
 #include <mach/board.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include "at91_mci.h"
 
@@ -460,9 +461,9 @@ static int mci_probe(struct device_d *hw_dev)
 	host->hw_dev = hw_dev;
 	hw_dev->priv = host;
 	host->clk = clk_get(hw_dev, "mci_clk");
-	if (host->clk == NULL) {
+	if (IS_ERR(host->clk)) {
 		dev_err(hw_dev, "no mci_clk\n");
-		return -EINVAL;
+		return PTR_ERR(host->clk);
 	}
 
 	clk_rate = clk_get_rate(host->clk);
-- 
1.7.4.1




More information about the barebox mailing list