powerpc/powermac: move pmac_pci_probe_mode from setup.c to pci.c
authorDaniel Axtens <dja@axtens.net>
Tue, 31 Mar 2015 05:00:40 +0000 (16:00 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 11 Apr 2015 10:49:10 +0000 (20:49 +1000)
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powermac/pci.c
arch/powerpc/platforms/powermac/pmac.h
arch/powerpc/platforms/powermac/setup.c

index f4071a67ad000407e7fc31ae7c0a457861ba371d..a792f4552442c42587539e3a0de43d28efc1b550 100644 (file)
@@ -1223,3 +1223,20 @@ static void fixup_u4_pcie(struct pci_dev* dev)
        pci_write_config_dword(dev, PCI_PREF_MEMORY_BASE, 0);
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie);
+
+#ifdef CONFIG_PPC64
+int pmac_pci_probe_mode(struct pci_bus *bus)
+{
+       struct device_node *node = pci_bus_to_OF_node(bus);
+
+       /* We need to use normal PCI probing for the AGP bus,
+        * since the device for the AGP bridge isn't in the tree.
+        * Same for the PCIe host on U4 and the HT host bridge.
+        */
+       if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
+                                 of_device_is_compatible(node, "u4-pcie") ||
+                                 of_device_is_compatible(node, "u3-ht")))
+               return PCI_PROBE_NORMAL;
+       return PCI_PROBE_DEVTREE;
+}
+#endif /* CONFIG_PPC64 */
index 8327cce2bdb01510fe4bbd54fbb805a9041ad7cd..46d219345537d2408417f0abdcb772eaa7b85627 100644 (file)
@@ -39,4 +39,8 @@ extern void low_cpu_die(void) __attribute__((noreturn));
 extern int pmac_nvram_init(void);
 extern void pmac_pic_init(void);
 
+#ifdef CONFIG_PPC64
+extern int pmac_pci_probe_mode(struct pci_bus *bus);
+#endif
+
 #endif /* __PMAC_H__ */
index 713d36d45d1d8d1e6628dfd3b207479ef8532a62..efe172db5f8ec479b10ac5bc981b8232bc0a5fc3 100644 (file)
@@ -637,24 +637,6 @@ static int __init pmac_probe(void)
        return 1;
 }
 
-#ifdef CONFIG_PPC64
-/* Move that to pci.c */
-static int pmac_pci_probe_mode(struct pci_bus *bus)
-{
-       struct device_node *node = pci_bus_to_OF_node(bus);
-
-       /* We need to use normal PCI probing for the AGP bus,
-        * since the device for the AGP bridge isn't in the tree.
-        * Same for the PCIe host on U4 and the HT host bridge.
-        */
-       if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
-                                 of_device_is_compatible(node, "u4-pcie") ||
-                                 of_device_is_compatible(node, "u3-ht")))
-               return PCI_PROBE_NORMAL;
-       return PCI_PROBE_DEVTREE;
-}
-#endif /* CONFIG_PPC64 */
-
 define_machine(powermac) {
        .name                   = "PowerMac",
        .probe                  = pmac_probe,