Re: Flaw in the driver-model implementation of attributes

From: Alan Stern (
Date: Mon Jun 16 2003 - 14:36:09 EST

On Mon, 16 Jun 2003, Russell King wrote:

> Have you noticed the two symlinks which are created from the class
> device. For example:
> /sysfs/class/pcmcia_socket/
> |-- pcmcia_socket0
> | |-- device -> ../../../devices/pci0/0000:00:01.0
> | |-- driver -> ../../../bus/pci/drivers/yenta_cardbus
> | `-- status
> `-- pcmcia_socket1
> |-- device -> ../../../devices/pci0/0000:00:01.1
> |-- driver -> ../../../bus/pci/drivers/yenta_cardbus
> `-- status
> This means you can access the physical device attributes using (eg):
> /sysfs/class/pcmcia_socket/pcmcia_socket0/device/resource
> the driver attributes:
> /sysfs/class/pcmcia_socket/pcmcia_socket0/driver/...
> and the class attributes:
> /sysfs/class/pcmcia_socket/pcmcia_socket0/...
> You don't have to try to work out where in /sys/bus and /sys/devices the
> driver and device respectively are - that's already done for you.

This doesn't provide any really good place to put device attributes that
are owned by the driver. They can't go in
because the driver doesn't own the device. They can't go in
because they aren't attributes of the _driver_, they're attributes of the
_device_. And they certainly aren't class attributes.

So where would you put them? You'd have to create another subdirectory of
owned by the driver. No really good name for this subdirectory spings
to mind, and it's still kind of awkward. But doable.

Alan Stern

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:19 EST