summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2007-01-16 12:17:13 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 15:50:06 -0800
commite36c455c2f5fee08fed395e94c7ab156cd159360 (patch)
treecfe0e29851b49893083108601bbee4ca9d38dc9e /drivers/pci/pci.c
parentc54c18790700b8b2a503945d729aa425c25691fe (diff)
downloadlinux-e36c455c2f5fee08fed395e94c7ab156cd159360.tar.gz
linux-e36c455c2f5fee08fed395e94c7ab156cd159360.tar.bz2
linux-e36c455c2f5fee08fed395e94c7ab156cd159360.zip
PCI: power management: remove noise on non-manageable hw
Return early from pci_set_power_state() if hardware does not support power management. This way, we do not generate noise in the logs. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e91dcc05b790..7ae709024456 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -392,6 +392,14 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
if (state > PCI_D3hot)
state = PCI_D3hot;
+ /*
+ * If the device or the parent bridge can't support PCI PM, ignore
+ * the request if we're doing anything besides putting it into D0
+ * (which would only happen on boot).
+ */
+ if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev))
+ return 0;
+
/* Validate current state:
* Can enter D0 from any state, but if we can only go deeper
* to sleep if we're already in a low power state
@@ -403,13 +411,6 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
} else if (dev->current_state == state)
return 0; /* we're already there */
- /*
- * If the device or the parent bridge can't support PCI PM, ignore
- * the request if we're doing anything besides putting it into D0
- * (which would only happen on boot).
- */
- if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev))
- return 0;
/* find PCI PM capability in list */
pm = pci_find_capability(dev, PCI_CAP_ID_PM);