aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-12 01:44:15 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-12 16:57:02 -0400
commit1e89d268e7a83d8388d4d09d3f2089ced72cc15f (patch)
tree7a0c92f6f5c8975612125ef8ff769656a2ab8aa4
parentf6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff)
PCI: When removing bus, always remove legacy files & unregister
We always call device_register() and pci_create_legacy_files() for a new bus before handing out the "struct pci_bus *". Therefore, there's no possiblity of removing the bus with pci_remove_bus() before those calls have been made, so we don't need to check "bus->is_added" before calling pci_remove_legacy_files() and device_unregister(). [bhelgaas: changelog] Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Yinghai Lu <yinghai@kernel.org> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Toshi Kani <toshi.kani@hp.com>
-rw-r--r--drivers/pci/remove.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index cc875e6ed159..a8318801c092 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -50,9 +50,6 @@ void pci_remove_bus(struct pci_bus *bus)
50 list_del(&bus->node); 50 list_del(&bus->node);
51 pci_bus_release_busn_res(bus); 51 pci_bus_release_busn_res(bus);
52 up_write(&pci_bus_sem); 52 up_write(&pci_bus_sem);
53 if (!bus->is_added)
54 return;
55
56 pci_remove_legacy_files(bus); 53 pci_remove_legacy_files(bus);
57 device_unregister(&bus->dev); 54 device_unregister(&bus->dev);
58} 55}