[RFC 5/7] staging: fbtft: don't require platform data

Noralf Trønnes noralf at tronnes.org
Tue Mar 3 11:15:40 UTC 2015


Den 02.03.2015 12:31, skrev Dan Carpenter:
> 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 <noralf at 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;

You're right. I missed that.

thanks,
Noralf.



More information about the devel mailing list