Re: Resource usages in Linux drivers

2015-04-23 Thread David Miller
From: Florian Fainelli Date: Thu, 23 Apr 2015 17:40:12 -0700 > Well, for one, we could have a device managed register_netdev() > which cleans up resources in case of failures and calls > free_netdev() automatically, but is that adding much value? I don't think it's worth it at all. -- To unsubsc

Re: Resource usages in Linux drivers

2015-04-23 Thread Florian Fainelli
On 23/04/15 16:19, Francois Romieu wrote: > Sergei Shtylyov : >> On 4/23/2015 1:08 PM, Jia-Ju Bai wrote: > [...] >>> I also find many drivers do not use these managed APIs, especially in >>> ethernet >>> card drivers (like e100, r8169). Is it possible to change them? >> >>Patches welcome. :-)

Re: Resource usages in Linux drivers

2015-04-23 Thread Francois Romieu
Sergei Shtylyov : > On 4/23/2015 1:08 PM, Jia-Ju Bai wrote: [...] > >I also find many drivers do not use these managed APIs, especially in > >ethernet > >card drivers (like e100, r8169). Is it possible to change them? > >Patches welcome. :-) I respectfully disagree. If someone believes bas

Re: Resource usages in Linux drivers

2015-04-23 Thread Sergei Shtylyov
On 4/23/2015 1:08 PM, Jia-Ju Bai wrote: I am very sorry to trouble you. I find that resource management is error-prone when writing Linux drivers, and many problems may occur, such as resource leaks. Meanwhile, I find that many applied patches in the kernel mailing list focus on releasing all

Re: Resource usages in Linux drivers

2015-04-23 Thread Jia-Ju Bai
On 04/23/2015 05:29 PM, Jia-Ju Bai wrote: Thank you! On 04/23/2015 05:19 PM, Sergei Shtylyov wrote: Hello. On 4/23/2015 9:45 AM, Jia-Ju Bai wrote: Dear Sir, I am very sorry to trouble you. I find that resource management is error-prone when writing Linux drivers, and many problems may

Re: Resource usages in Linux drivers

2015-04-23 Thread Jia-Ju Bai
Thank you! On 04/23/2015 05:19 PM, Sergei Shtylyov wrote: Hello. On 4/23/2015 9:45 AM, Jia-Ju Bai wrote: Dear Sir, I am very sorry to trouble you. I find that resource management is error-prone when writing Linux drivers, and many problems may occur, such as resource leaks. Meanwhile,