diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2022-03-08 20:20:20 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-05-06 00:00:20 +1000 |
commit | 0aa297e73bba35bedadbd2d452c62d643dfd4a32 (patch) | |
tree | 44eb6ac0346ca091e0895ed00da7e4e060ce2ad0 /arch/powerpc/kernel/pci_64.c | |
parent | f206fdd9d41bf7deb96219b8ca3499a5abd79b83 (diff) | |
download | linux-0aa297e73bba35bedadbd2d452c62d643dfd4a32.tar.gz |
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
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 3fb7e572abed..81f84e71ab93 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -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; +} |