]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/pci/pci.c
MIPS: PCI: Make pcibios_set_cache_line_size an initcall
[karo-tx-linux.git] / arch / mips / pci / pci.c
index b4c02f29663e180aeb5635aba2f4d9eabd24980c..30320a4c890914eb8f03b18794984f0576c0fea7 100644 (file)
@@ -28,8 +28,7 @@
 /*
  * The PCI controller list.
  */
-
-static struct pci_controller *hose_head, **hose_tail = &hose_head;
+static LIST_HEAD(controllers);
 
 unsigned long PCIBIOS_MIN_IO;
 unsigned long PCIBIOS_MIN_MEM;
@@ -96,8 +95,8 @@ static void pcibios_scanbus(struct pci_controller *hose)
                                &resources);
        hose->bus = bus;
 
-       need_domain_info = need_domain_info || hose->index;
-       hose->need_domain_info = need_domain_info;
+       need_domain_info = need_domain_info || pci_domain_nr(bus);
+       set_pci_need_domain_info(hose, need_domain_info);
 
        if (!bus) {
                pci_free_resource_list(&resources);
@@ -193,8 +192,8 @@ void register_pci_controller(struct pci_controller *hose)
                goto out;
        }
 
-       *hose_tail = hose;
-       hose_tail = &hose->next;
+       INIT_LIST_HEAD(&hose->list);
+       list_add(&hose->list, &controllers);
 
        /*
         * Do not panic here but later - this might happen before console init.
@@ -221,7 +220,7 @@ out:
               "Skipping PCI bus scan due to resource conflict\n");
 }
 
-static void __init pcibios_set_cache_line_size(void)
+static int __init pcibios_set_cache_line_size(void)
 {
        struct cpuinfo_mips *c = &current_cpu_data;
        unsigned int lsize;
@@ -239,16 +238,16 @@ static void __init pcibios_set_cache_line_size(void)
        pci_dfl_cache_line_size = lsize >> 2;
 
        pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize);
+       return 0;
 }
+arch_initcall(pcibios_set_cache_line_size);
 
 static int __init pcibios_init(void)
 {
        struct pci_controller *hose;
 
-       pcibios_set_cache_line_size();
-
        /* Scan all of the recorded PCI controllers.  */
-       for (hose = hose_head; hose; hose = hose->next)
+       list_for_each_entry(hose, &controllers, list)
                pcibios_scanbus(hose);
 
        pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);