aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/portdrv_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pcie/portdrv_pci.c')
-rw-r--r--drivers/pci/pcie/portdrv_pci.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 50bfc1b2f3bf..478d0d28f7ad 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -30,23 +30,6 @@ MODULE_LICENSE("GPL");
30/* global data */ 30/* global data */
31static const char device_name[] = "pcieport-driver"; 31static const char device_name[] = "pcieport-driver";
32 32
33static int pcie_portdrv_save_config(struct pci_dev *dev)
34{
35 return pci_save_state(dev);
36}
37
38static int pcie_portdrv_restore_config(struct pci_dev *dev)
39{
40 int retval;
41
42 pci_restore_state(dev);
43 retval = pci_enable_device(dev);
44 if (retval)
45 return retval;
46 pci_set_master(dev);
47 return 0;
48}
49
50/* 33/*
51 * pcie_portdrv_probe - Probe PCI-Express port devices 34 * pcie_portdrv_probe - Probe PCI-Express port devices
52 * @dev: PCI-Express port device being probed 35 * @dev: PCI-Express port device being probed
@@ -73,8 +56,10 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
73 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", 56 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n",
74 __FUNCTION__, dev->device, dev->vendor); 57 __FUNCTION__, dev->device, dev->vendor);
75 } 58 }
76 if (pcie_port_device_register(dev)) 59 if (pcie_port_device_register(dev)) {
60 pci_disable_device(dev);
77 return -ENOMEM; 61 return -ENOMEM;
62 }
78 63
79 return 0; 64 return 0;
80} 65}
@@ -86,6 +71,23 @@ static void pcie_portdrv_remove (struct pci_dev *dev)
86} 71}
87 72
88#ifdef CONFIG_PM 73#ifdef CONFIG_PM
74static int pcie_portdrv_save_config(struct pci_dev *dev)
75{
76 return pci_save_state(dev);
77}
78
79static int pcie_portdrv_restore_config(struct pci_dev *dev)
80{
81 int retval;
82
83 pci_restore_state(dev);
84 retval = pci_enable_device(dev);
85 if (retval)
86 return retval;
87 pci_set_master(dev);
88 return 0;
89}
90
89static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) 91static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state)
90{ 92{
91 int ret = pcie_port_device_suspend(dev, state); 93 int ret = pcie_port_device_suspend(dev, state);