summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-01-07 13:10:35 +0100
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 11:18:04 -0800
commit98e6e286d7b01deb7453b717aa38ebb69d6cefc0 (patch)
tree3dbaf0cdc71a779f6f1d3bed8f9fd17eeabb97cd /drivers
parentad8cfa1defee14a5181d9b63e666318c51cfaeed (diff)
downloadop-kernel-dev-98e6e286d7b01deb7453b717aa38ebb69d6cefc0.zip
op-kernel-dev-98e6e286d7b01deb7453b717aa38ebb69d6cefc0.tar.gz
PCI PM: Register power state of devices during initialization
Use the observation that the power state of a PCI device can be loaded into its pci_dev structure as soon as pci_pm_init() is run for it and make that happen. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e491fde..c12f6c7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1260,14 +1260,15 @@ void pci_pm_init(struct pci_dev *dev)
/* find PCI PM capability in list */
pm = pci_find_capability(dev, PCI_CAP_ID_PM);
if (!pm)
- return;
+ goto Exit;
+
/* Check device's ability to generate PME# */
pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc);
if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
dev_err(&dev->dev, "unsupported PM cap regs version (%u)\n",
pmc & PCI_PM_CAP_VER_MASK);
- return;
+ goto Exit;
}
dev->pm_cap = pm;
@@ -1306,6 +1307,9 @@ void pci_pm_init(struct pci_dev *dev)
} else {
dev->pme_support = 0;
}
+
+ Exit:
+ pci_update_current_state(dev, PCI_D0);
}
/**
OpenPOWER on IntegriCloud