aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/pci/pci.c')
-rw-r--r--arch/mips/pci/pci.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 5ace368657ad..8108231f2e20 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -77,8 +77,28 @@ pcibios_align_resource(void *data, struct resource *res,
77 77
78void __init register_pci_controller(struct pci_controller *hose) 78void __init register_pci_controller(struct pci_controller *hose)
79{ 79{
80 if (request_resource(&iomem_resource, hose->mem_resource) < 0)
81 goto out;
82 if (request_resource(&ioport_resource, hose->io_resource) < 0) {
83 release_resource(hose->mem_resource);
84 goto out;
85 }
86
80 *hose_tail = hose; 87 *hose_tail = hose;
81 hose_tail = &hose->next; 88 hose_tail = &hose->next;
89
90 /*
91 * Do not panic here but later - this might hapen before console init.
92 */
93 if (!hose->io_map_base) {
94 printk(KERN_WARNING
95 "registering PCI controller with io_map_base unset\n");
96 }
97 return;
98
99out:
100 printk(KERN_WARNING
101 "Skipping PCI bus scan due to resource conflict\n");
82} 102}
83 103
84/* Most MIPS systems have straight-forward swizzling needs. */ 104/* Most MIPS systems have straight-forward swizzling needs. */
@@ -113,11 +133,6 @@ static int __init pcibios_init(void)
113 /* Scan all of the recorded PCI controllers. */ 133 /* Scan all of the recorded PCI controllers. */
114 for (next_busno = 0, hose = hose_head; hose; hose = hose->next) { 134 for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
115 135
116 if (request_resource(&iomem_resource, hose->mem_resource) < 0)
117 goto out;
118 if (request_resource(&ioport_resource, hose->io_resource) < 0)
119 goto out_free_mem_resource;
120
121 if (!hose->iommu) 136 if (!hose->iommu)
122 PCI_DMA_BUS_IS_PHYS = 1; 137 PCI_DMA_BUS_IS_PHYS = 1;
123 138
@@ -136,14 +151,6 @@ static int __init pcibios_init(void)
136 need_domain_info = 1; 151 need_domain_info = 1;
137 } 152 }
138 } 153 }
139 continue;
140
141out_free_mem_resource:
142 release_resource(hose->mem_resource);
143
144out:
145 printk(KERN_WARNING
146 "Skipping PCI bus scan due to resource conflict\n");
147 } 154 }
148 155
149 if (!pci_probe_only) 156 if (!pci_probe_only)
@@ -223,7 +230,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
223 return pcibios_plat_dev_init(dev); 230 return pcibios_plat_dev_init(dev);
224} 231}
225 232
226static void __init pcibios_fixup_device_resources(struct pci_dev *dev, 233static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev,
227 struct pci_bus *bus) 234 struct pci_bus *bus)
228{ 235{
229 /* Update device resources. */ 236 /* Update device resources. */