lkml.org 
[lkml]   [2013]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Consult] Why need we call device_remove_file() firstly before call device_unregister() ?
On 05/20/2013 09:45 AM, Greg Kroah-Hartman wrote:
> On Mon, May 20, 2013 at 09:03:27AM +0800, Chen Gang wrote:
>> > On 05/18/2013 07:06 PM, Ming Lei wrote:
>>> > > Hi,
>>> > >
>>> > > On Fri, May 17, 2013 at 1:43 PM, Chen Gang <gang.chen@asianux.com> wrote:
>>>> > >> Hello All:
>>>> > >>
>>>> > >> I searched 'arch/*' and 'drivers/*' sub-directory, all of them are 'obey
>>>> > >> this rule', even in device_unregister() itself, it also firstly calls
>>>> > >> device_remove_file(), then call kobject_del().
>>>> > >>
>>>> > >> But after read the related code (fs/sysfs/*, drivers/base/core.c), it
>>>> > >> seems kobject_del() -> sysfs_remove_dir() which will release all related
>>>> > >> things (can instead of device_remove_file()).
>>>> > >>
>>>> > >> So in fact, we need not call device_remove_file() before call
>>>> > >> device_unregister(), is it correct ?
>>> > >
>>> > > Looks it is correct but it is a bit implicit.
>>> > >
>> >
>> > If really no other members reply within a week, we should treat your
>> > opinion (or suggestion) as the final result conclusion within
>> > linux-kernel@vger.kernel.org. :-)
> I have no idea what you mean by this.
>

I mean that if no reply by any other members within a week, I will know
it is correct that "we need not call device_remove_file() firstly before
call device_unregister()" (at least, one member's reply supports this
conclusion).

I find this 'question' when discussing a patch with another members in
linux-kernel@vger.kernel.org, I have read the related code and also have
searched with google, but can not find the result, so I want to consult
it in linux-kernel@vger.kernel.org.

And I think, this 'question' is not suitable to give a test firstly,
because the test plan need be discussed firstly (or the test result
means nothing).


This time, I send the 'consult' mail to 'All', not to specific members.


Thanks.
--
Chen Gang

Asianux Corporation


\
 
 \ /
  Last update: 2013-05-20 05:01    [W:0.135 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site