Re: [PATCH 06/16] nuc900fb: don't treat NULL clk as an error

From: Wan ZongShun
Date: Tue Jan 11 2011 - 20:24:54 EST


2011/1/11 Jamie Iles <jamie@xxxxxxxxxxxxx>:
> 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: Wan ZongShun <mcuos.com@xxxxxxxxx>
> Cc: linux-fbdev@xxxxxxxxxxxxxxx
> Signed-off-by: Jamie Iles <jamie@xxxxxxxxxxxxx>
> ---
> Â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 81687ed..62498bd 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -15,6 +15,7 @@
> Â*/
> Â#include <linux/module.h>
> Â#include <linux/kernel.h>
> +#include <linux/err.h>
> Â#include <linux/errno.h>
> Â#include <linux/string.h>
> Â#include <linux/mm.h>
> @@ -597,9 +598,9 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev)
> Â Â Â Â}
>
> Â Â Â Âfbi->clk = clk_get(&pdev->dev, NULL);
> - Â Â Â if (!fbi->clk || IS_ERR(fbi->clk)) {
> + Â Â Â if (IS_ERR(fbi->clk)) {
> Â Â Â Â Â Â Â Âprintk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n");
> - Â Â Â Â Â Â Â ret = -ENOENT;
> + Â Â Â Â Â Â Â ret = PTR_ERR(fbi->clk);
> Â Â Â Â Â Â Â Âgoto release_irq;
> Â Â Â Â}
>
Hi,

Thanks for your patch.

Acked-by: Wan ZongShun <mcuos.com@xxxxxxxxx>

> --
> 1.7.3.4
>
>



--
*linux-arm-kernel mailing list
mail addr:linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
you can subscribe by:
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

* linux-arm-NUC900 mailing list
mail addr:NUC900@xxxxxxxxxxxxxxxx
main web: https://groups.google.com/group/NUC900
you can subscribe it by sending me mail:
mcuos.com@xxxxxxxxx
--
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/