From 7b54366358008241f88228f02cc80ab352265eac Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Mon, 2 Apr 2012 18:31:53 -0700 Subject: 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 Signed-off-by: Bjorn Helgaas --- drivers/pci/host-bridge.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'drivers/pci/host-bridge.c') diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index c49a1c482cfb..122df80592c3 100644 --- a/drivers/pci/host-bridge.c +++ b/drivers/pci/host-bridge.c @@ -9,13 +9,6 @@ #include "pci.h" -static LIST_HEAD(pci_host_bridges); - -void add_to_pci_host_bridges(struct pci_host_bridge *bridge) -{ - list_add_tail(&bridge->list, &pci_host_bridges); -} - static struct pci_bus *find_pci_root_bus(struct pci_dev *dev) { struct pci_bus *bus; @@ -30,14 +23,8 @@ static struct pci_bus *find_pci_root_bus(struct pci_dev *dev) static struct pci_host_bridge *find_pci_host_bridge(struct pci_dev *dev) { struct pci_bus *bus = find_pci_root_bus(dev); - struct pci_host_bridge *bridge; - - list_for_each_entry(bridge, &pci_host_bridges, list) { - if (bridge->bus == bus) - return bridge; - } - return NULL; + return to_pci_host_bridge(bus->bridge); } static bool resource_contains(struct resource *res1, struct resource *res2) -- cgit v1.2.1