Commit 2d3c1b46 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: remove BUG()s in pcibios_fixup_bus

BUG() on missing IO or memory resources in pcibios_fixup_bus is rude, remove
it.  Also use list_for_each_entry.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c4121e77
...@@ -815,9 +815,6 @@ EXPORT_SYMBOL(pcibios_fixup_device_resources); ...@@ -815,9 +815,6 @@ EXPORT_SYMBOL(pcibios_fixup_device_resources);
void __devinit pcibios_fixup_bus(struct pci_bus *bus) void __devinit pcibios_fixup_bus(struct pci_bus *bus)
{ {
struct pci_controller *hose = PCI_GET_PHB_PTR(bus); struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
struct list_head *ln;
/* XXX or bus->parent? */
struct pci_dev *dev = bus->self; struct pci_dev *dev = bus->self;
struct resource *res; struct resource *res;
int i; int i;
...@@ -827,18 +824,13 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) ...@@ -827,18 +824,13 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
hose->bus = bus; hose->bus = bus;
bus->resource[0] = res = &hose->io_resource; bus->resource[0] = res = &hose->io_resource;
if (!res->flags)
BUG(); /* No I/O resource for this PHB? */
if (request_resource(&ioport_resource, res)) if (res->flags && request_resource(&ioport_resource, res))
printk(KERN_ERR "Failed to request IO on " printk(KERN_ERR "Failed to request IO on "
"PCI domain %d\n", pci_domain_nr(bus)); "PCI domain %d\n", pci_domain_nr(bus));
for (i = 0; i < 3; ++i) { for (i = 0; i < 3; ++i) {
res = &hose->mem_resources[i]; res = &hose->mem_resources[i];
if (!res->flags && i == 0)
BUG(); /* No memory resource for this PHB? */
bus->resource[i+1] = res; bus->resource[i+1] = res;
if (res->flags && request_resource(&iomem_resource, res)) if (res->flags && request_resource(&iomem_resource, res))
printk(KERN_ERR "Failed to request MEM on " printk(KERN_ERR "Failed to request MEM on "
...@@ -853,12 +845,10 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) ...@@ -853,12 +845,10 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
pcibios_fixup_device_resources(dev, bus); pcibios_fixup_device_resources(dev, bus);
} }
/* XXX Need to check why Alpha doesnt do this - Anton */
if (!pci_probe_only) if (!pci_probe_only)
return; return;
for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { list_for_each_entry(dev, &bus->devices, bus_list) {
struct pci_dev *dev = pci_dev_b(ln);
if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
pcibios_fixup_device_resources(dev, bus); pcibios_fixup_device_resources(dev, bus);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment