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

From: Jamie Iles
Date: Tue Jan 11 2011 - 07:46:22 EST


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@xxxxxxxxx>
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Jamie Iles <jamie@xxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/