Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/64: Move pci_device_from_OF_node() out of asm/pci-bridge.h

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

authored by

Christophe Leroy and committed by
Michael Ellerman
0aa297e7 f206fdd9

+11 -12
+2 -12
arch/powerpc/include/asm/pci-bridge.h
··· 170 170 return bus->sysdata; 171 171 } 172 172 173 - #ifndef CONFIG_PPC64 174 - 175 173 extern int pci_device_from_OF_node(struct device_node *node, 176 174 u8 *bus, u8 *devfn); 175 + #ifndef CONFIG_PPC64 176 + 177 177 extern void pci_create_OF_bus_map(void); 178 178 179 179 #else /* CONFIG_PPC64 */ ··· 234 234 struct pci_dn *add_sriov_vf_pdns(struct pci_dev *pdev); 235 235 void remove_sriov_vf_pdns(struct pci_dev *pdev); 236 236 #endif 237 - 238 - static inline int pci_device_from_OF_node(struct device_node *np, 239 - u8 *bus, u8 *devfn) 240 - { 241 - if (!PCI_DN(np)) 242 - return -ENODEV; 243 - *bus = PCI_DN(np)->busno; 244 - *devfn = PCI_DN(np)->devfn; 245 - return 0; 246 - } 247 237 248 238 #if defined(CONFIG_EEH) 249 239 static inline struct eeh_dev *pdn_to_eeh_dev(struct pci_dn *pdn)
+9
arch/powerpc/kernel/pci_64.c
··· 285 285 } 286 286 EXPORT_SYMBOL(pcibus_to_node); 287 287 #endif 288 + 289 + int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn) 290 + { 291 + if (!PCI_DN(np)) 292 + return -ENODEV; 293 + *bus = PCI_DN(np)->busno; 294 + *devfn = PCI_DN(np)->devfn; 295 + return 0; 296 + }