On Fri, Nov 14, 2008 at 08:55:38AM +0800, Greg KH wrote:
The problem is the sysfs directory of the PCI device is created by the
kobject_add() in the device_add() as follows. And the static entries
bundled with the 'pci_bus_type' are created by the bus_add_device().
Between the kobject_add() and the kobject_uevent(), we don't have any
other choice to add the dynamic entries.
In device_add():
error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id);
...
error = bus_add_device(dev);
...
kobject_uevent(&dev->kobj, KOBJ_ADD);
So looks like the only way is to make the dynamic entries bundled with
the 'pci_bus_type', which means they would become static no matter the
device supports the entries (i.e. corresponding capabilities) or not.
Thanks,
Yu
--