2022-03-09 01:39:49

by Christophe Leroy

[permalink] [raw]
Subject: [PATCH v1 1/6] 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 <[email protected]>
---
arch/powerpc/include/asm/pci-bridge.h | 14 ++------------
arch/powerpc/kernel/pci_64.c | 9 +++++++++
2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 90f488fa4c17..c85f901227c9 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -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)
{
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;
+}
--
2.34.1


2022-05-16 10:11:21

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH v1 1/6] powerpc/64: Move pci_device_from_OF_node() out of asm/pci-bridge.h

On Tue, 8 Mar 2022 20:20:20 +0100, Christophe Leroy wrote:
> 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)
>
> [...]

Applied to powerpc/next.

[1/6] powerpc/64: Move pci_device_from_OF_node() out of asm/pci-bridge.h
https://git.kernel.org/powerpc/c/0aa297e73bba35bedadbd2d452c62d643dfd4a32
[2/6] powerpc: Don't include asm/prom.h in asm/parport.h
https://git.kernel.org/powerpc/c/07071346bb76f4fbc2c1ca8894ec3d3ad2f22577
[3/6] powerpc: Include asm/reg.h in asm/svm.h
https://git.kernel.org/powerpc/c/eb4713c40a619046af99586743d48b9b4435d371
[4/6] powerpc: Add missing declaration in asm/drmem.h
https://git.kernel.org/powerpc/c/669df99c957561dddf580ec269fb4255c41dabc1
[5/6] powerpc: Remove asm/prom.h from all files that don't need it
https://git.kernel.org/powerpc/c/86c38fec69a461846d84f250f281e8cfbe54b25a
[6/6] powerpc: Add missing headers
https://git.kernel.org/powerpc/c/e6f6390ab7b9d649c13de2c8a591bce61a10ec3b

cheers