diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-03-29 19:10:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-08 15:05:57 -0400 |
commit | 8fe2b65a18e49bfde56a59ed4ab3fc7aa0c2f325 (patch) | |
tree | a813fe635b7a8c248c586de847d1501c4ccaab6b /drivers/ssb/pcihost_wrapper.c | |
parent | 5100d5ac81b9330dc57e35adbe50923ba6107b8f (diff) |
ssb: Turn suspend/resume upside down
Turn the SSB bus suspend mechanism upside down.
Instead of deciding by an internal reference count when to suspend/resume,
let the parent bus call us in their suspend/resume routine.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/pcihost_wrapper.c')
-rw-r--r-- | drivers/ssb/pcihost_wrapper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ssb/pcihost_wrapper.c b/drivers/ssb/pcihost_wrapper.c index 82a10abef640..e82db4aaa050 100644 --- a/drivers/ssb/pcihost_wrapper.c +++ b/drivers/ssb/pcihost_wrapper.c | |||
@@ -18,6 +18,12 @@ | |||
18 | #ifdef CONFIG_PM | 18 | #ifdef CONFIG_PM |
19 | static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state) | 19 | static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state) |
20 | { | 20 | { |
21 | struct ssb_bus *ssb = pci_get_drvdata(dev); | ||
22 | int err; | ||
23 | |||
24 | err = ssb_bus_suspend(ssb); | ||
25 | if (err) | ||
26 | return err; | ||
21 | pci_save_state(dev); | 27 | pci_save_state(dev); |
22 | pci_disable_device(dev); | 28 | pci_disable_device(dev); |
23 | pci_set_power_state(dev, pci_choose_state(dev, state)); | 29 | pci_set_power_state(dev, pci_choose_state(dev, state)); |
@@ -27,6 +33,7 @@ static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state) | |||
27 | 33 | ||
28 | static int ssb_pcihost_resume(struct pci_dev *dev) | 34 | static int ssb_pcihost_resume(struct pci_dev *dev) |
29 | { | 35 | { |
36 | struct ssb_bus *ssb = pci_get_drvdata(dev); | ||
30 | int err; | 37 | int err; |
31 | 38 | ||
32 | pci_set_power_state(dev, 0); | 39 | pci_set_power_state(dev, 0); |
@@ -34,6 +41,9 @@ static int ssb_pcihost_resume(struct pci_dev *dev) | |||
34 | if (err) | 41 | if (err) |
35 | return err; | 42 | return err; |
36 | pci_restore_state(dev); | 43 | pci_restore_state(dev); |
44 | err = ssb_bus_resume(ssb); | ||
45 | if (err) | ||
46 | return err; | ||
37 | 47 | ||
38 | return 0; | 48 | return 0; |
39 | } | 49 | } |