diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-01-11 07:43:43 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-12 01:00:32 -0500 |
commit | ec03031707a348578c6ded277e5d92eb21de4fce (patch) | |
tree | 4adf97316956eb4b48235c12f7dbaebd76ea97e3 /drivers/video/nuc900fb.c | |
parent | 0b2e9cb42cd0b5b0c95a776e30c9ecdff16587ea (diff) |
nuc900fb: don't treat NULL clk as an error
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: linux-fbdev@vger.kernel.org
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/nuc900fb.c')
-rw-r--r-- | drivers/video/nuc900fb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c index 81687ed26ba9..62498bd662fc 100644 --- a/drivers/video/nuc900fb.c +++ b/drivers/video/nuc900fb.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/err.h> | ||
18 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
19 | #include <linux/string.h> | 20 | #include <linux/string.h> |
20 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
@@ -597,9 +598,9 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev) | |||
597 | } | 598 | } |
598 | 599 | ||
599 | fbi->clk = clk_get(&pdev->dev, NULL); | 600 | fbi->clk = clk_get(&pdev->dev, NULL); |
600 | if (!fbi->clk || IS_ERR(fbi->clk)) { | 601 | if (IS_ERR(fbi->clk)) { |
601 | printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n"); | 602 | printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n"); |
602 | ret = -ENOENT; | 603 | ret = PTR_ERR(fbi->clk); |
603 | goto release_irq; | 604 | goto release_irq; |
604 | } | 605 | } |
605 | 606 | ||