Messages in this thread | | | Date | Fri, 17 Feb 2012 20:57:14 +0530 | From | Aneesh V <> | Subject | Re: [RFC PATCH 4/8] misc: emif: add basic infrastructure for EMIF driver |
| |
On Friday 17 February 2012 07:14 PM, Cousson, Benoit wrote: > Hi Aneesh,
[...]
>>>> + emif = kzalloc(sizeof(struct emif_data), GFP_KERNEL); >>> >>> You should use the devm_* version of this API to get the simplify the >>> error handling / removal. >> >> Please note that most of my allocations are happening through >> kmemdup(). kmemdup() doesn't have a devm_* equivalent. So, I have a >> cleanup() function and in the interest of uniformity decided to avoid >> devm_* variants altogether. > > I think it still worth using devm_kzalloc + memcopy here instead of > kmemdup to avoid the cleanup() and simplify as well the error handling.
I will do that.
> > You might even propose a new devm_kmemdup API if you want.
Ok. I will attempt that, maybe both devm_kmalloc() and devm_kmemdup(). But I would like to de-couple that from this series. That is, I will do the patch separately and if that gets up-streamed I will update EMIF driver to use them. Until then I will go with what you suggested above.
br, Aneesh
| |