Re: [PATCH] Driver Core patches for 2.6.7

From: Greg KH
Date: Tue Jun 22 2004 - 18:54:24 EST


On Tue, Jun 22, 2004 at 06:44:38PM -0500, Dmitry Torokhov wrote:
> On Tuesday 22 June 2004 06:31 pm, Greg KH wrote:
> > On Tue, Jun 22, 2004 at 06:21:01PM -0500, Dmitry Torokhov wrote:
> > > On Tuesday 22 June 2004 12:41 pm, Greg KH wrote:
> > >
> > > >
> > > > void class_unregister(struct class * cls)
> > > > {
> > > > pr_debug("device class '%s': unregistering\n",cls->name);
> > > > + remove_class_attrs(cls);
> > > > subsystem_unregister(&cls->subsys);
> > > > }
> > > >
> > >
> > > Question: is it necessary to call remove_class_attrs? I thought that sysfs
> > > automatically destroys all children when parent is destroyed? Am I imagining
> > > things?
> >
> > No, you aren't imagining things. But it's considered "good form" to
> > remove them if you can, as this will probably change in 2.7, and it will
> > make my life easier trying to audit the whole tree at that time...
> >
>
> Is there any specific reason for such a change? I kinda like the idea of
> registering attributes and then having driver code do the bean counting
> for me.

Watch out if your driver is unloaded, but the device is still hanging
around. If that could happen, you need to get rid of those attributes.

But the main reason is we want to split attributes out of sysfs to make
sysfs simpler, and provide the ability for other representations of the
driver tree other than sysfs. But more about this at the kernel
summit...

> Btw, is there a chance for platform_device_register_simple that I sent to
> you earlier be included?

Yes, it's in my todo queue, trying to catch up on older patches still,
will get to it by the end of the week, sorry for the delay.

thanks,

greg k-h
-
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/