Re: Flaw in the driver-model implementation of attributes

Greg KH (greg@kroah.com)
Tue, 17 Jun 2003 10:33:44 -0700


On Tue, Jun 17, 2003 at 01:29:31PM -0400, Alan Stern wrote:
> On Mon, 16 Jun 2003, Greg KH wrote:
>
> > All disk info is in the /sys/block directory, does that work for you?
>
> Not scsi disk info. (Or maybe it should be there but it isn't.) And no,
> it doesn't work for me because it's owned by the scsi core, not my driver.
>
> > I think the scsi core will create you a directory that you can use that
> > will have the proper lifetime that you are looking for. If not, I can
> > look into doing something else for some of the other USB devices that
> > are not using the USB major.
>
> I don't think it would be appropriate to use that directory, since my
> driver wouldn't own it.
>
> How about creating a /sys/class/usb/usb-storage/ directory, under which
> there could be a directory for each USB mass-storage device? Or would it
> be better to create a usb-storage.# directory under the interface's
> directory in /sys/devices/ ?

class/usb-storage/ would be fine with me.

> It's worth pointing out that both the OHCI and EHCI drivers also do the
> same wrong thing. They create their attribute files in a directory
> owned by the PCI driver.

Yup, you are correct, time to add class/usb-host/ :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/