powerpc/64: Move pci_device_from_OF_node() out of asm/pci-bridge.h
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 8 Mar 2022 19:20:20 +0000 (20:20 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 5 May 2022 14:00:20 +0000 (00:00 +1000)
Move pci_device_from_OF_node() in pci64.c because it needs definition
of struct device_node and is not worth inlining.

ppc32.c already has it in pci32.c.

That way pci-bridge.h doesn't need linux/of.h (Brought by asm/prom.h
via asm/pci.h)

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3c88286b55413730d7784133993a46ef4a3607ce.1646767214.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/pci_64.c

index 90f488fa4c175c0376c12ccfabdd939ebebcb05c..c85f901227c976523d3a869e30e4fe17ff8bbc1f 100644 (file)
@@ -170,10 +170,10 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
        return bus->sysdata;
 }
 
-#ifndef CONFIG_PPC64
-
 extern int pci_device_from_OF_node(struct device_node *node,
                                   u8 *bus, u8 *devfn);
+#ifndef CONFIG_PPC64
+
 extern void pci_create_OF_bus_map(void);
 
 #else  /* CONFIG_PPC64 */
@@ -235,16 +235,6 @@ struct pci_dn *add_sriov_vf_pdns(struct pci_dev *pdev);
 void remove_sriov_vf_pdns(struct pci_dev *pdev);
 #endif
 
-static inline int pci_device_from_OF_node(struct device_node *np,
-                                         u8 *bus, u8 *devfn)
-{
-       if (!PCI_DN(np))
-               return -ENODEV;
-       *bus = PCI_DN(np)->busno;
-       *devfn = PCI_DN(np)->devfn;
-       return 0;
-}
-
 #if defined(CONFIG_EEH)
 static inline struct eeh_dev *pdn_to_eeh_dev(struct pci_dn *pdn)
 {
index 3fb7e572abedfa3214016ccab1481e0d1da39d42..81f84e71ab930e44d17151be29f5d990203f2745 100644 (file)
@@ -285,3 +285,12 @@ int pcibus_to_node(struct pci_bus *bus)
 }
 EXPORT_SYMBOL(pcibus_to_node);
 #endif
+
+int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn)
+{
+       if (!PCI_DN(np))
+               return -ENODEV;
+       *bus = PCI_DN(np)->busno;
+       *devfn = PCI_DN(np)->devfn;
+       return 0;
+}