Re: [patch] Move led attributes out of device name and into sysfsattributes, was Re: LED devices

From: Greg KH
Date: Fri Jun 08 2007 - 14:58:56 EST

On Fri, Jun 01, 2007 at 05:23:24PM +0100, Richard Purdie wrote:
> On Fri, 2007-06-01 at 16:59 +0100, Richard Hughes wrote:
> > On Fri, 2007-06-01 at 16:43 +0100, Richard Purdie wrote:
> > > I accept this is basically out of my hands now. Greg/Kay have the
> > > appropriate emails and if they'll let me know which approach they want
> > > to take, I'll apply an appropriate patch. I'd suggest not applying this
> > > patch directly as it introduces a race in the error path it alters.
> >
> > Sure, I really wanted to convert the class to struct device (which I'm
> > more familiar with) but just tried to do minimal changes. What changes
> > need to be made to avoid a race? Thanks.
> It has nothing to do with the struct device vs. class devices, you need
> to think more carefully about the placement of the list_del().
> My other concerns with this patch are that it exports incorrect
> information on spitz (which I had warned about and I will get bug
> reports about) and that "description" is not really a suitable name for
> a sysfs attribute, "function" might give a better idea of what it
> represents to developers.
> I still question whether either colour or function properties are
> actually particularly useful to userspace other than for naming purposes
> which is why they were part of the device name.
> Anyhow, I'm trying not to say too much more as it will just go in
> circles. I'll await a reply from Greg.

Hm, I thought I made my opinion pretty clear in the beginning.

Why not just do a simple:

and so on?

And use the 'name' field to put the name of your device (disk,
bluetooth, etc.) This is the way all other busses and devices work, and
I don't think that LEDs are anything more "special" than anything else
in the kernel, right?

So the original patch in this thread is close, but not quite there.


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
Please read the FAQ at