Re: [PATCH 2/4] drivers/video/au*fb.c: use devm_ functions
From: Manuel Lauss
Date: Sat Jan 21 2012 - 09:01:37 EST
Hello,
On Sat, Jan 21, 2012 at 2:53 PM, Florian Tobias Schandinat
<FlorianSchandinat@xxxxxx> wrote:
> [CC'ing Manuel Lauss as he knows those drivers better than I do]
>
> On 01/20/2012 09:25 PM, Julia Lawall wrote:
>> From: Julia Lawall <Julia.Lawall@xxxxxxx>
>>
>> The various devm_ functions allocate memory that is released when a driver
>> detaches. This patch uses these functions for data that is allocated in
>> the probe function of a platform device and is only freed in the remove
>> function.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@xxxxxxx>
>>
>> ---
>> In the case of au1100fb.c, should the failed label return something other
>> than 0?
>> In the case of au1200fb.c, should the error-handling code under the new
>> call to dma_alloc_noncoherent jump to failed, like the other error handling
>> code? I was not sure that there was actually anything for failed to do at
>> this point in the function.
>
> Maybe Manuel is able to answer these questions. I've queued this patch and if he
> doesn't respond I'll apply it after some time.
au1100fb: Yes, a -ENODEV instead of 0 in the error case is probably a
good idea.
au1200fb: The error path(s) are buggy; they don't free all windows if
creation of
the 4th fails for example. It has been this way
since the driver appeared
but for all current use cases (demoboards and in
the field) it actually works.
I'm working on a rewrite which is however
progressing rather slowly.
>> drivers/video/au1100fb.c | 30 +++++++++++-------------------
>> drivers/video/au1200fb.c | 9 +--------
>> 2 files changed, 12 insertions(+), 27 deletions(-)
Acked-by: Manuel Lauss <manuel.lauss@xxxxxxxxxxxxxx>
[...]
Thanks!
Manuel Lauss
--
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/