Re: [Consult] Why need we call device_remove_file() firstly beforecall device_unregister() ?

From: Chen Gang
Date: Sun May 19 2013 - 21:04:27 EST


On 05/18/2013 07:06 PM, Ming Lei wrote:
> Hi,
>
> On Fri, May 17, 2013 at 1:43 PM, Chen Gang <gang.chen@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx :-)


Thanks.
--
Chen Gang

Asianux Corporation
--
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/