Skip to content

Commit 1e89d26

Browse files
jiangliubjorn-helgaas
authored andcommitted
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>
1 parent f6161aa commit 1e89d26

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

‎drivers/pci/remove.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ void pci_remove_bus(struct pci_bus *bus)
5050
list_del(&bus->node);
5151
pci_bus_release_busn_res(bus);
5252
up_write(&pci_bus_sem);
53-
if (!bus->is_added)
54-
return;
55-
5653
pci_remove_legacy_files(bus);
5754
device_unregister(&bus->dev);
5855
}

0 commit comments

Comments
 (0)