--- drivers/base/power/sysfs.c | 7 +++++-- drivers/pci/probe.c | 1 + include/linux/device.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/drivers/base/power/sysfs.c +++ gregkh-2.6/drivers/base/power/sysfs.c @@ -186,10 +186,13 @@ static struct attribute_group pm_attr_gr int dpm_sysfs_add(struct device * dev) { - return sysfs_create_group(&dev->kobj, &pm_attr_group); + if (dev->pm_aware) + return sysfs_create_group(&dev->kobj, &pm_attr_group); + return 0; } void dpm_sysfs_remove(struct device * dev) { - sysfs_remove_group(&dev->kobj, &pm_attr_group); + if (dev->pm_aware) + sysfs_remove_group(&dev->kobj, &pm_attr_group); } --- gregkh-2.6.orig/drivers/pci/probe.c +++ gregkh-2.6/drivers/pci/probe.c @@ -893,6 +893,7 @@ pci_scan_device(struct pci_bus *bus, int dev->sysdata = bus->sysdata; dev->dev.parent = bus->bridge; dev->dev.bus = &pci_bus_type; + dev->dev.pm_aware = 1; dev->devfn = devfn; dev->hdr_type = hdr_type & 0x7f; dev->multifunction = !!(hdr_type & 0x80); --- gregkh-2.6.orig/include/linux/device.h +++ gregkh-2.6/include/linux/device.h @@ -403,6 +403,7 @@ struct device { struct device_type *type; unsigned is_registered:1; unsigned no_suspend:1; + unsigned pm_aware:1; struct device_attribute uevent_attr; struct device_attribute *devt_attr;