Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40379
b: refs/heads/master
c: 2449e06
h: refs/heads/master
i:
  40377: d9fdd7a
  40375: 6b7ed64
v: v3
  • Loading branch information
Shaohua Li authored and Greg Kroah-Hartman committed Oct 27, 2006
1 parent 8d41bd9 commit c51a183
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3095fc0c9772b4afb3c81f76664f341ef716d380
refs/heads/master: 2449e06a5696b7af1c8a369b04c97f3b139cf3bb
13 changes: 13 additions & 0 deletions trunk/drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ static int pci_device_remove(struct device * dev)
pci_dev->driver = NULL;
}

/*
* If the device is still on, set the power state as "unknown",
* since it might change by the next time we load the driver.
*/
if (pci_dev->current_state == PCI_D0)
pci_dev->current_state = PCI_UNKNOWN;

/*
* We would love to complain here if pci_dev->is_enabled is set, that
* the driver should have called pci_disable_device(), but the
Expand All @@ -288,6 +295,12 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
suspend_report_result(drv->suspend, i);
} else {
pci_save_state(pci_dev);
/*
* mark its power state as "unknown", since we don't know if
* e.g. the BIOS will change its device state when we suspend.
*/
if (pci_dev->current_state == PCI_D0)
pci_dev->current_state = PCI_UNKNOWN;
}
return i;
}
Expand Down

0 comments on commit c51a183

Please sign in to comment.