summaryrefslogtreecommitdiffstats
path: root/drivers/ssb/pcihost_wrapper.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-03-30 00:10:50 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 15:05:57 -0400
commit8fe2b65a18e49bfde56a59ed4ab3fc7aa0c2f325 (patch)
treea813fe635b7a8c248c586de847d1501c4ccaab6b /drivers/ssb/pcihost_wrapper.c
parent5100d5ac81b9330dc57e35adbe50923ba6107b8f (diff)
downloadlinux-8fe2b65a18e49bfde56a59ed4ab3fc7aa0c2f325.tar.gz
linux-8fe2b65a18e49bfde56a59ed4ab3fc7aa0c2f325.tar.bz2
linux-8fe2b65a18e49bfde56a59ed4ab3fc7aa0c2f325.zip
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.c10
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 @@
#ifdef CONFIG_PM
static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
{
+ struct ssb_bus *ssb = pci_get_drvdata(dev);
+ int err;
+
+ err = ssb_bus_suspend(ssb);
+ if (err)
+ return err;
pci_save_state(dev);
pci_disable_device(dev);
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)
static int ssb_pcihost_resume(struct pci_dev *dev)
{
+ struct ssb_bus *ssb = pci_get_drvdata(dev);
int err;
pci_set_power_state(dev, 0);
@@ -34,6 +41,9 @@ static int ssb_pcihost_resume(struct pci_dev *dev)
if (err)
return err;
pci_restore_state(dev);
+ err = ssb_bus_resume(ssb);
+ if (err)
+ return err;
return 0;
}