diff options
Diffstat (limited to 'arch/sparc/kernel/leon_pci.c')
-rw-r--r-- | arch/sparc/kernel/leon_pci.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index 4371f72ff025..98c223edac84 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c | |||
@@ -25,6 +25,12 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) | |||
25 | { | 25 | { |
26 | LIST_HEAD(resources); | 26 | LIST_HEAD(resources); |
27 | struct pci_bus *root_bus; | 27 | struct pci_bus *root_bus; |
28 | struct pci_host_bridge *bridge; | ||
29 | int ret; | ||
30 | |||
31 | bridge = pci_alloc_host_bridge(0); | ||
32 | if (!bridge) | ||
33 | return; | ||
28 | 34 | ||
29 | pci_add_resource_offset(&resources, &info->io_space, | 35 | pci_add_resource_offset(&resources, &info->io_space, |
30 | info->io_space.start - 0x1000); | 36 | info->io_space.start - 0x1000); |
@@ -32,15 +38,21 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) | |||
32 | info->busn.flags = IORESOURCE_BUS; | 38 | info->busn.flags = IORESOURCE_BUS; |
33 | pci_add_resource(&resources, &info->busn); | 39 | pci_add_resource(&resources, &info->busn); |
34 | 40 | ||
35 | root_bus = pci_scan_root_bus(&ofdev->dev, 0, info->ops, info, | 41 | list_splice_init(&resources, &bridge->windows); |
36 | &resources); | 42 | bridge->dev.parent = &ofdev->dev; |
37 | if (!root_bus) { | 43 | bridge->sysdata = info; |
38 | pci_free_resource_list(&resources); | 44 | bridge->busnr = 0; |
45 | bridge->ops = info->ops; | ||
46 | bridge->swizzle_irq = pci_common_swizzle; | ||
47 | bridge->map_irq = info->map_irq; | ||
48 | |||
49 | ret = pci_scan_root_bus_bridge(bridge); | ||
50 | if (ret) { | ||
51 | pci_free_host_bridge(bridge); | ||
39 | return; | 52 | return; |
40 | } | 53 | } |
41 | 54 | ||
42 | /* Setup IRQs of all devices using custom routines */ | 55 | root_bus = bridge->bus; |
43 | pci_fixup_irqs(pci_common_swizzle, info->map_irq); | ||
44 | 56 | ||
45 | /* Assign devices with resources */ | 57 | /* Assign devices with resources */ |
46 | pci_assign_unassigned_resources(); | 58 | pci_assign_unassigned_resources(); |
@@ -94,9 +106,3 @@ void pcibios_fixup_bus(struct pci_bus *pbus) | |||
94 | } | 106 | } |
95 | } | 107 | } |
96 | } | 108 | } |
97 | |||
98 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
99 | resource_size_t size, resource_size_t align) | ||
100 | { | ||
101 | return res->start; | ||
102 | } | ||