aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma/host_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bcma/host_pci.c')
-rw-r--r--drivers/bcma/host_pci.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 443b83a2fd7a..f59244e33971 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -235,38 +235,32 @@ static void bcma_host_pci_remove(struct pci_dev *dev)
235} 235}
236 236
237#ifdef CONFIG_PM 237#ifdef CONFIG_PM
238static int bcma_host_pci_suspend(struct pci_dev *dev, pm_message_t state) 238static int bcma_host_pci_suspend(struct device *dev)
239{ 239{
240 /* Host specific */ 240 struct pci_dev *pdev = to_pci_dev(dev);
241 pci_save_state(dev); 241 struct bcma_bus *bus = pci_get_drvdata(pdev);
242 pci_disable_device(dev);
243 pci_set_power_state(dev, pci_choose_state(dev, state));
244 242
245 return 0; 243 bus->mapped_core = NULL;
244
245 return bcma_bus_suspend(bus);
246} 246}
247 247
248static int bcma_host_pci_resume(struct pci_dev *dev) 248static int bcma_host_pci_resume(struct device *dev)
249{ 249{
250 struct bcma_bus *bus = pci_get_drvdata(dev); 250 struct pci_dev *pdev = to_pci_dev(dev);
251 int err; 251 struct bcma_bus *bus = pci_get_drvdata(pdev);
252 252
253 /* Host specific */ 253 return bcma_bus_resume(bus);
254 pci_set_power_state(dev, 0); 254}
255 err = pci_enable_device(dev);
256 if (err)
257 return err;
258 pci_restore_state(dev);
259 255
260 /* Bus specific */ 256static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend,
261 err = bcma_bus_resume(bus); 257 bcma_host_pci_resume);
262 if (err) 258#define BCMA_PM_OPS (&bcma_pm_ops)
263 return err;
264 259
265 return 0;
266}
267#else /* CONFIG_PM */ 260#else /* CONFIG_PM */
268# define bcma_host_pci_suspend NULL 261
269# define bcma_host_pci_resume NULL 262#define BCMA_PM_OPS NULL
263
270#endif /* CONFIG_PM */ 264#endif /* CONFIG_PM */
271 265
272static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = { 266static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
@@ -284,8 +278,7 @@ static struct pci_driver bcma_pci_bridge_driver = {
284 .id_table = bcma_pci_bridge_tbl, 278 .id_table = bcma_pci_bridge_tbl,
285 .probe = bcma_host_pci_probe, 279 .probe = bcma_host_pci_probe,
286 .remove = bcma_host_pci_remove, 280 .remove = bcma_host_pci_remove,
287 .suspend = bcma_host_pci_suspend, 281 .driver.pm = BCMA_PM_OPS,
288 .resume = bcma_host_pci_resume,
289}; 282};
290 283
291int __init bcma_host_pci_init(void) 284int __init bcma_host_pci_init(void)