public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Consult] Why need we call device_remove_file() firstly before call device_unregister() ?
@ 2013-05-17  5:43 Chen Gang
  2013-05-18 11:06 ` Ming Lei
  0 siblings, 1 reply; 7+ messages in thread
From: Chen Gang @ 2013-05-17  5:43 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

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 ?


Welcome any member to give a suggestion or completion about it, thanks.


Thanks.
-- 
Chen Gang

Asianux Corporation

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-20  2:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17  5:43 [Consult] Why need we call device_remove_file() firstly before call device_unregister() ? Chen Gang
2013-05-18 11:06 ` Ming Lei
2013-05-20  1:03   ` Chen Gang
2013-05-20  1:45     ` Greg Kroah-Hartman
2013-05-20  2:12       ` Chen Gang
2013-05-20  2:20         ` Greg Kroah-Hartman
2013-05-20  2:42           ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox