PCI: add generic device into pci_host_bridge struct

Use that device for pci_root_bus bridge pointer.

Use pci_release_bus_bridge_dev() to release allocated pci_host_bridge in
remove path.

Use root bus bridge pointer to get host bridge pointer instead of searching
host bridge list.  That leaves the host bridge list unused, so remove it.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
Yinghai Lu
2012-04-02 18:31:53 -07:00
committed by Bjorn Helgaas
parent 459f58ce51
commit 7b54366358
4 changed files with 40 additions and 49 deletions

View File

@@ -375,11 +375,13 @@ struct pci_host_bridge_window {
};
struct pci_host_bridge {
struct list_head list;
struct device dev;
struct pci_bus *bus; /* root bus */
struct list_head windows; /* pci_host_bridge_windows */
};
#define to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev)
/*
* The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond
* to P2P or CardBus bridge windows) go in a table. Additional ones (for