PCI PM: Add suspend counterpart of pci_reenable_device
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 7 Jan 2009 12:03:42 +0000 (13:03 +0100)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 7 Jan 2009 19:14:40 +0000 (11:14 -0800)
commitfa58d305d9925b01830e535896a7227a868a9e15
tree6b0509663958c9fc6c3b201e6a3b061af784ffa9
parentc9b9972b3c88272be02d971346285d1c67fbb95f
PCI PM: Add suspend counterpart of pci_reenable_device

PCI devices without drivers are not disabled during suspend and
hibernation, but they are enabled during resume, with the help of
pci_reenable_device(), so there is an unbalanced execution of
pcibios_enable_device() in the resume code path.

To correct this introduce function pci_disable_enabled_device()
that will disable the argument device, if it is enabled when the
function is being run, without updating the device's pci_dev
structure and use it in the suspend code path to balance the
pci_reenable_device() executed during resume.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci-driver.c
drivers/pci/pci.c
drivers/pci/pci.h