[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVXFVNiWwiXtubJSbE3z6-AyxcOBgyvhn+2diHyi5Nyj4XYeg@mail.gmail.com>
Date: Sat, 18 May 2013 19:06:13 +0800
From: Ming Lei <tom.leiming@...il.com>
To: Chen Gang <gang.chen@...anux.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [Consult] Why need we call device_remove_file() firstly before
call device_unregister() ?
Hi,
On Fri, May 17, 2013 at 1:43 PM, Chen Gang <gang.chen@...anux.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.
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists