Re: [PATCH 2/4] drivers/video/au*fb.c: use devm_ functions
From: Manuel Lauss <hidden>
Date: 2012-01-21 14:01:28
Also in:
kernel-janitors, lkml
Hello, On Sat, Jan 21, 2012 at 2:53 PM, Florian Tobias Schandinat [off-list ref] wrote:
[CC'ing Manuel Lauss as he knows those drivers better than I do] On 01/20/2012 09:25 PM, Julia Lawall wrote:quoted
From: Julia Lawall <redacted> 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 <redacted> --- 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.
quoted
drivers/video/au1100fb.c | 30 +++++++++++------------------- drivers/video/au1200fb.c | 9 +-------- 2 files changed, 12 insertions(+), 27 deletions(-)
Acked-by: Manuel Lauss <redacted>
[...]
Thanks!
Manuel Lauss