[PATCH v3 22/22] drm/tilcdc: Use devm_kzalloc() and devm_kcalloc() for private data

Jyri Sarha jsarha at ti.com
Wed Feb 24 12:48:44 UTC 2016


On 02/24/16 14:38, Tomi Valkeinen wrote:
>
> On 23/02/16 17:03, Jyri Sarha wrote:
>> Use devm_kzalloc() and devm_kcalloc() for private data allocation at
>> driver load time.
>>
>> Signed-off-by: Jyri Sarha <jsarha at ti.com>
>> ---
>>   drivers/gpu/drm/tilcdc/tilcdc_crtc.c   |  4 +---
>>   drivers/gpu/drm/tilcdc/tilcdc_drv.c    | 19 +++++++------------
>>   drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 20 ++++++--------------
>>   drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 24 +++++++-----------------
>>   4 files changed, 21 insertions(+), 46 deletions(-)
>
> I see you took one step further and used devm_alloc for the crtcs and
> encoders etc too =). I don't see why that wouldn't work, though, as they
> are all created at init time and freed when the driver exits.
>
> However, at least omapdrm does handle freeing in the specific _destroy
> callbacks, so I do wonder if there's some reason for that...
>

The same is more or less true also for the driver load() and unload(), 
functions that you originally commented in the "drm/tilcdc: Allocate 
register storage based on the actual number registers".

> Did you test with tilcdc as module, with all the kernel debug options
> enabled, and a few load/unload module cycles?
>

I did couple of load and unload cycles, but not sure about the options. 
I'll do that again, this time with all the debug options I can think of 
active.

Best regards,
Jyri







More information about the dri-devel mailing list