From 62afd7a604d9340f17f83a4dfa18ee5b735a5879 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 28 Oct 2011 16:27:58 -0600 Subject: [PATCH] --- yaml --- r: 283383 b: refs/heads/master c: 2b591616ada6cf499a4e83bf453761e40dc53059 h: refs/heads/master i: 283381: cce8e3f5c90f7c85001264b4a8018bbd93d2196b 283379: b12cf3211cbbdfe7f83be30733e3f80dfcc150b4 283375: 230ebeba7eb9803d9ef87b47b2222de5bde5de23 v: v3 --- [refs] | 2 +- trunk/arch/sparc/kernel/leon_pci.c | 25 ++++++++----------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 5afc9777e063..ad63b8b3b2b7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1a300107b5a49e3b7da080ae4827a9ee17c49a25 +refs/heads/master: 2b591616ada6cf499a4e83bf453761e40dc53059 diff --git a/trunk/arch/sparc/kernel/leon_pci.c b/trunk/arch/sparc/kernel/leon_pci.c index f1cf6ef011a7..c7bec25fdb1c 100644 --- a/trunk/arch/sparc/kernel/leon_pci.c +++ b/trunk/arch/sparc/kernel/leon_pci.c @@ -19,22 +19,22 @@ */ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) { + LIST_HEAD(resources); struct pci_bus *root_bus; - root_bus = pci_scan_bus_parented(&ofdev->dev, 0, info->ops, info); - if (root_bus) { - root_bus->resource[0] = &info->io_space; - root_bus->resource[1] = &info->mem_space; - root_bus->resource[2] = NULL; - - /* Init all PCI devices into PCI tree */ - pci_bus_add_devices(root_bus); + pci_add_resource(&resources, &info->io_space); + pci_add_resource(&resources, &info->mem_space); + root_bus = pci_scan_root_bus(&ofdev->dev, 0, info->ops, info, + &resources); + if (root_bus) { /* Setup IRQs of all devices using custom routines */ pci_fixup_irqs(pci_common_swizzle, info->map_irq); /* Assign devices with resources */ pci_assign_unassigned_resources(); + } else { + pci_free_resource_list(&resources); } } @@ -83,15 +83,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *pbus) int i, has_io, has_mem; u16 cmd; - /* Generic PCI bus probing sets these to point at - * &io{port,mem}_resouce which is wrong for us. - */ - if (pbus->self == NULL) { - pbus->resource[0] = &info->io_space; - pbus->resource[1] = &info->mem_space; - pbus->resource[2] = NULL; - } - list_for_each_entry(dev, &pbus->devices, bus_list) { /* * We can not rely on that the bootloader has enabled I/O