hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/intersil/orinoco/orinoco_pci.h
....@@ -18,51 +18,37 @@
1818 void __iomem *attr_io;
1919 };
2020
21
-#ifdef CONFIG_PM
22
-static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)
21
+static int __maybe_unused orinoco_pci_suspend(struct device *dev_d)
2322 {
23
+ struct pci_dev *pdev = to_pci_dev(dev_d);
2424 struct orinoco_private *priv = pci_get_drvdata(pdev);
2525
2626 orinoco_down(priv);
2727 free_irq(pdev->irq, priv);
28
- pci_save_state(pdev);
29
- pci_disable_device(pdev);
30
- pci_set_power_state(pdev, PCI_D3hot);
3128
3229 return 0;
3330 }
3431
35
-static int orinoco_pci_resume(struct pci_dev *pdev)
32
+static int __maybe_unused orinoco_pci_resume(struct device *dev_d)
3633 {
34
+ struct pci_dev *pdev = to_pci_dev(dev_d);
3735 struct orinoco_private *priv = pci_get_drvdata(pdev);
3836 struct net_device *dev = priv->ndev;
3937 int err;
40
-
41
- pci_set_power_state(pdev, PCI_D0);
42
- err = pci_enable_device(pdev);
43
- if (err) {
44
- printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
45
- dev->name);
46
- return err;
47
- }
48
- pci_restore_state(pdev);
4938
5039 err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
5140 dev->name, priv);
5241 if (err) {
5342 printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n",
5443 dev->name);
55
- pci_disable_device(pdev);
5644 return -EBUSY;
5745 }
5846
59
- err = orinoco_up(priv);
60
-
61
- return err;
47
+ return orinoco_up(priv);
6248 }
63
-#else
64
-#define orinoco_pci_suspend NULL
65
-#define orinoco_pci_resume NULL
66
-#endif
49
+
50
+static SIMPLE_DEV_PM_OPS(orinoco_pci_pm_ops,
51
+ orinoco_pci_suspend,
52
+ orinoco_pci_resume);
6753
6854 #endif /* _ORINOCO_PCI_H */