[PATCH 09/16] ARM: pxa: don't treat NULL clk as an error

Jamie Iles jamie at jamieiles.com
Tue Jan 11 07:43:46 EST 2011


clk_get() returns a struct clk cookie to the driver and some platforms
may return NULL if they only support a single clock.  clk_get() has only
failed if it returns a ERR_PTR() encoded pointer.

Cc: Eric Miao <eric.y.miao at gmail.com>
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Jamie Iles <jamie at jamieiles.com>
---
 drivers/pcmcia/pxa2xx_base.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 3755e7c..6e5b55e 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -16,6 +16,7 @@
 
   ======================================================================*/
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
@@ -297,8 +298,8 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
 	}
 
 	clk = clk_get(&dev->dev, NULL);
-	if (!clk)
-		return -ENODEV;
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
 
 	pxa2xx_drv_pcmcia_ops(ops);
 
-- 
1.7.3.4




More information about the linux-arm-kernel mailing list