Merge ../linus
[pandora-kernel.git] / arch / mips / pci / pci.c
index a8d499b..ba66f8c 100644 (file)
@@ -51,11 +51,11 @@ unsigned long PCIBIOS_MIN_MEM       = 0;
  */
 void
 pcibios_align_resource(void *data, struct resource *res,
-                      unsigned long size, unsigned long align)
+                      resource_size_t size, resource_size_t align)
 {
        struct pci_dev *dev = data;
        struct pci_controller *hose = dev->sysdata;
-       unsigned long start = res->start;
+       resource_size_t start = res->start;
 
        if (res->flags & IORESOURCE_IO) {
                /* Make sure we start at our min on all hoses */
@@ -76,11 +76,6 @@ pcibios_align_resource(void *data, struct resource *res,
        res->start = start;
 }
 
-struct pci_controller * __init alloc_pci_controller(void)
-{
-       return alloc_bootmem(sizeof(struct pci_controller));
-}
-
 void __init register_pci_controller(struct pci_controller *hose)
 {
        *hose_tail = hose;
@@ -127,15 +122,20 @@ static int __init pcibios_init(void)
                if (!hose->iommu)
                        PCI_DMA_BUS_IS_PHYS = 1;
 
+               if (hose->get_busno && pci_probe_only)
+                       next_busno = (*hose->get_busno)();
+
                bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
                hose->bus = bus;
                hose->need_domain_info = need_domain_info;
-               next_busno = bus->subordinate + 1;
-               /* Don't allow 8-bit bus number overflow inside the hose -
-                  reserve some space for bridges. */
-               if (next_busno > 224) {
-                       next_busno = 0;
-                       need_domain_info = 1;
+               if (bus) {
+                       next_busno = bus->subordinate + 1;
+                       /* Don't allow 8-bit bus number overflow inside the hose -
+                          reserve some space for bridges. */
+                       if (next_busno > 224) {
+                               next_busno = 0;
+                               need_domain_info = 1;
+                       }
                }
                continue;
 
@@ -164,7 +164,7 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
 
        pci_read_config_word(dev, PCI_COMMAND, &cmd);
        old_cmd = cmd;
-       for(idx=0; idx<6; idx++) {
+       for (idx=0; idx < PCI_NUM_RESOURCES; idx++) {
                /* Only set up the requested stuff */
                if (!(mask & (1<<idx)))
                        continue;