On Mon, Mar 02, 2015 at 11:54:27AM +0100, Noralf Trønnes wrote:
> Add dummy platform data when it's not present.
> 
> Signed-off-by: Noralf Trønnes <nor...@tronnes.org>
> ---
>  drivers/staging/fbtft/fbtft-core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-core.c 
> b/drivers/staging/fbtft/fbtft-core.c
> index ac4287f..59c17c1 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -719,10 +719,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct 
> fbtft_display *display,
>       if (!bpp)
>               bpp = 16;
>  
> -     if (!pdata) {
> -             dev_err(dev, "platform data is missing\n");
> -             return NULL;
> -     }
> +     if (!pdata)
> +             pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);

This is weird.  pdata is zeroed out so the info is a bit useless.  We
don't use it outside this function.  Later in the function, then should
we do?

-       par->pdata = dev->platform_data;
+       par->pdata = pdata;

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to