Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7915
b: refs/heads/master
c: 3fe9d19
h: refs/heads/master
i:
  7913: d55de82
  7911: b9a917f
v: v3
  • Loading branch information
Daniel Ritz authored and Greg Kroah-Hartman committed Sep 8, 2005
1 parent 74636c2 commit c00e9d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cecf4864cf52a4a243a62b2856a6a155edbb55e8
refs/heads/master: 3fe9d19f9e86a55679f5f2b38ec0a43a1a510cee
12 changes: 5 additions & 7 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,20 +294,18 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
return -EIO;

pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
if ((pmc & PCI_PM_CAP_VER_MASK) > 2) {
if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
printk(KERN_DEBUG
"PCI: %s has unsupported PM cap regs version (%u)\n",
pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);
return -EIO;
}

/* check if this device supports the desired state */
if (state == PCI_D1 || state == PCI_D2) {
if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1))
return -EIO;
else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2))
return -EIO;
}
if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1))
return -EIO;
else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2))
return -EIO;

pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ static int pci_setup_device(struct pci_dev * dev)
dev->vendor, dev->device, class, dev->hdr_type);

/* "Unknown power state" */
dev->current_state = 4;
dev->current_state = PCI_UNKNOWN;

/* Early fixups, before probing the BARs */
pci_fixup_device(pci_fixup_early, dev);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ typedef int __bitwise pci_power_t;
#define PCI_D2 ((pci_power_t __force) 2)
#define PCI_D3hot ((pci_power_t __force) 3)
#define PCI_D3cold ((pci_power_t __force) 4)
#define PCI_UNKNOWN ((pci_power_t __force) 5)
#define PCI_POWER_ERROR ((pci_power_t __force) -1)

/*
Expand Down

0 comments on commit c00e9d9

Please sign in to comment.