diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2011-10-28 18:27:48 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-01-06 15:11:10 -0500 |
commit | 6f17dd1ba96bb857fc1e8ab0357a6a0a09935baf (patch) | |
tree | 50a20c19dbbeeac43ceb4c908928c042bcfd1651 /arch/sh/drivers | |
parent | 45a709f890a7b84930942a5f5f82011312fe727c (diff) |
sh/PCI: convert to pci_scan_root_bus() for correct root bus resources
Convert from pci_scan_bus() to pci_scan_root_bus() and remove root bus
resource fixups. This fixes the problem of "early" and "header" quirks
seeing incorrect root bus resources.
CC: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/sh/drivers')
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 05de3b2d82c5..5872c798d62d 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -36,9 +36,15 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose) | |||
36 | { | 36 | { |
37 | static int next_busno; | 37 | static int next_busno; |
38 | static int need_domain_info; | 38 | static int need_domain_info; |
39 | LIST_HEAD(resources); | ||
40 | int i; | ||
39 | struct pci_bus *bus; | 41 | struct pci_bus *bus; |
40 | 42 | ||
41 | bus = pci_scan_bus(next_busno, hose->pci_ops, hose); | 43 | for (i = 0; i < hose->nr_resources; i++) |
44 | pci_add_resource(&resources, hose->resources + i); | ||
45 | |||
46 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, | ||
47 | &resources); | ||
42 | hose->bus = bus; | 48 | hose->bus = bus; |
43 | 49 | ||
44 | need_domain_info = need_domain_info || hose->index; | 50 | need_domain_info = need_domain_info || hose->index; |
@@ -55,6 +61,8 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose) | |||
55 | pci_bus_size_bridges(bus); | 61 | pci_bus_size_bridges(bus); |
56 | pci_bus_assign_resources(bus); | 62 | pci_bus_assign_resources(bus); |
57 | pci_enable_bridges(bus); | 63 | pci_enable_bridges(bus); |
64 | } else { | ||
65 | pci_free_resource_list(&resources); | ||
58 | } | 66 | } |
59 | } | 67 | } |
60 | 68 | ||
@@ -162,16 +170,8 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev, | |||
162 | */ | 170 | */ |
163 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | 171 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) |
164 | { | 172 | { |
165 | struct pci_dev *dev = bus->self; | 173 | struct pci_dev *dev; |
166 | struct list_head *ln; | 174 | struct list_head *ln; |
167 | struct pci_channel *hose = bus->sysdata; | ||
168 | |||
169 | if (!dev) { | ||
170 | int i; | ||
171 | |||
172 | for (i = 0; i < hose->nr_resources; i++) | ||
173 | bus->resource[i] = hose->resources + i; | ||
174 | } | ||
175 | 175 | ||
176 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { | 176 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { |
177 | dev = pci_dev_b(ln); | 177 | dev = pci_dev_b(ln); |