aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r--drivers/pci/remove.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 430281b2e921..ec4a82ba29a8 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -1,5 +1,6 @@
1#include <linux/pci.h> 1#include <linux/pci.h>
2#include <linux/module.h> 2#include <linux/module.h>
3#include <linux/aspm.h>
3#include "pci.h" 4#include "pci.h"
4 5
5static void pci_free_resources(struct pci_dev *dev) 6static void pci_free_resources(struct pci_dev *dev)
@@ -30,6 +31,9 @@ static void pci_stop_dev(struct pci_dev *dev)
30 dev->global_list.next = dev->global_list.prev = NULL; 31 dev->global_list.next = dev->global_list.prev = NULL;
31 up_write(&pci_bus_sem); 32 up_write(&pci_bus_sem);
32 } 33 }
34
35 if (dev->bus->self)
36 pcie_aspm_exit_link_state(dev);
33} 37}
34 38
35static void pci_destroy_dev(struct pci_dev *dev) 39static void pci_destroy_dev(struct pci_dev *dev)
@@ -74,10 +78,8 @@ void pci_remove_bus(struct pci_bus *pci_bus)
74 list_del(&pci_bus->node); 78 list_del(&pci_bus->node);
75 up_write(&pci_bus_sem); 79 up_write(&pci_bus_sem);
76 pci_remove_legacy_files(pci_bus); 80 pci_remove_legacy_files(pci_bus);
77 class_device_remove_file(&pci_bus->class_dev, 81 device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity);
78 &class_device_attr_cpuaffinity); 82 device_unregister(&pci_bus->dev);
79 sysfs_remove_link(&pci_bus->class_dev.kobj, "bridge");
80 class_device_unregister(&pci_bus->class_dev);
81} 83}
82EXPORT_SYMBOL(pci_remove_bus); 84EXPORT_SYMBOL(pci_remove_bus);
83 85