diff options
Diffstat (limited to 'drivers/pci/host-bridge.c')
-rw-r--r-- | drivers/pci/host-bridge.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index a68dc613a5be..06ace6248c61 100644 --- a/drivers/pci/host-bridge.c +++ b/drivers/pci/host-bridge.c | |||
@@ -9,22 +9,19 @@ | |||
9 | 9 | ||
10 | #include "pci.h" | 10 | #include "pci.h" |
11 | 11 | ||
12 | static struct pci_bus *find_pci_root_bus(struct pci_dev *dev) | 12 | static struct pci_bus *find_pci_root_bus(struct pci_bus *bus) |
13 | { | 13 | { |
14 | struct pci_bus *bus; | ||
15 | |||
16 | bus = dev->bus; | ||
17 | while (bus->parent) | 14 | while (bus->parent) |
18 | bus = bus->parent; | 15 | bus = bus->parent; |
19 | 16 | ||
20 | return bus; | 17 | return bus; |
21 | } | 18 | } |
22 | 19 | ||
23 | static struct pci_host_bridge *find_pci_host_bridge(struct pci_dev *dev) | 20 | static struct pci_host_bridge *find_pci_host_bridge(struct pci_bus *bus) |
24 | { | 21 | { |
25 | struct pci_bus *bus = find_pci_root_bus(dev); | 22 | struct pci_bus *root_bus = find_pci_root_bus(bus); |
26 | 23 | ||
27 | return to_pci_host_bridge(bus->bridge); | 24 | return to_pci_host_bridge(root_bus->bridge); |
28 | } | 25 | } |
29 | 26 | ||
30 | void pci_set_host_bridge_release(struct pci_host_bridge *bridge, | 27 | void pci_set_host_bridge_release(struct pci_host_bridge *bridge, |
@@ -40,10 +37,10 @@ static bool resource_contains(struct resource *res1, struct resource *res2) | |||
40 | return res1->start <= res2->start && res1->end >= res2->end; | 37 | return res1->start <= res2->start && res1->end >= res2->end; |
41 | } | 38 | } |
42 | 39 | ||
43 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 40 | void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, |
44 | struct resource *res) | 41 | struct resource *res) |
45 | { | 42 | { |
46 | struct pci_host_bridge *bridge = find_pci_host_bridge(dev); | 43 | struct pci_host_bridge *bridge = find_pci_host_bridge(bus); |
47 | struct pci_host_bridge_window *window; | 44 | struct pci_host_bridge_window *window; |
48 | resource_size_t offset = 0; | 45 | resource_size_t offset = 0; |
49 | 46 | ||
@@ -68,10 +65,10 @@ static bool region_contains(struct pci_bus_region *region1, | |||
68 | return region1->start <= region2->start && region1->end >= region2->end; | 65 | return region1->start <= region2->start && region1->end >= region2->end; |
69 | } | 66 | } |
70 | 67 | ||
71 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 68 | void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, |
72 | struct pci_bus_region *region) | 69 | struct pci_bus_region *region) |
73 | { | 70 | { |
74 | struct pci_host_bridge *bridge = find_pci_host_bridge(dev); | 71 | struct pci_host_bridge *bridge = find_pci_host_bridge(bus); |
75 | struct pci_host_bridge_window *window; | 72 | struct pci_host_bridge_window *window; |
76 | resource_size_t offset = 0; | 73 | resource_size_t offset = 0; |
77 | 74 | ||