diff options
author | Daniel Drake <dsd@gentoo.org> | 2007-11-21 17:55:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-28 16:53:53 -0500 |
commit | dec13c15445fec29ca9087890895718450e80b95 (patch) | |
tree | cac4cfb2d665344973cb4d953d3d7785ae612a0d /drivers/base/core.c | |
parent | 345ee8392dc149ca529f80e40583928977ad592e (diff) |
create /sys/.../power when CONFIG_PM is set
The CONFIG_SUSPEND changes in 2.6.23 caused a regression under certain
configuration conditions (SUSPEND=n, USB_AUTOSUSPEND=y) where all USB
device attributes in sysfs (idVendor, idProduct, ...) silently disappeared,
causing udev breakage and more.
The cause of this is that the /sys/.../power subdirectory is now only
created when CONFIG_PM_SLEEP is set, however, it should be created whenever
CONFIG_PM is set to handle the above situation. The following patch fixes
the regression.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r-- | drivers/base/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 3f4d6aa13990..2683eac30c68 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -770,9 +770,10 @@ int device_add(struct device *dev) | |||
770 | error = device_add_attrs(dev); | 770 | error = device_add_attrs(dev); |
771 | if (error) | 771 | if (error) |
772 | goto AttrsError; | 772 | goto AttrsError; |
773 | error = device_pm_add(dev); | 773 | error = dpm_sysfs_add(dev); |
774 | if (error) | 774 | if (error) |
775 | goto PMError; | 775 | goto PMError; |
776 | device_pm_add(dev); | ||
776 | error = bus_add_device(dev); | 777 | error = bus_add_device(dev); |
777 | if (error) | 778 | if (error) |
778 | goto BusError; | 779 | goto BusError; |
@@ -797,6 +798,7 @@ int device_add(struct device *dev) | |||
797 | return error; | 798 | return error; |
798 | BusError: | 799 | BusError: |
799 | device_pm_remove(dev); | 800 | device_pm_remove(dev); |
801 | dpm_sysfs_remove(dev); | ||
800 | PMError: | 802 | PMError: |
801 | if (dev->bus) | 803 | if (dev->bus) |
802 | blocking_notifier_call_chain(&dev->bus->bus_notifier, | 804 | blocking_notifier_call_chain(&dev->bus->bus_notifier, |