Skip to content

Commit

Permalink
powerpc/pci: Hide pci_device_from_OF_node() for non-powermac code
Browse files Browse the repository at this point in the history
Function pci_device_from_OF_node() is used only in powermac code. So
hide it from all other platforms.

Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
pali authored and mpe committed Jul 27, 2022
1 parent 0531a4a commit a2954a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
return bus->sysdata;
}

#ifdef CONFIG_PPC_PMAC
extern int pci_device_from_OF_node(struct device_node *node,
u8 *bus, u8 *devfn);
#endif
#ifndef CONFIG_PPC64

extern void pci_create_OF_bus_map(void);
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ pcibios_make_OF_bus_map(void)
}


#ifdef CONFIG_PPC_PMAC
/*
* Returns the PCI device matching a given OF node
*/
Expand Down Expand Up @@ -193,6 +194,7 @@ int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn)
return -ENODEV;
}
EXPORT_SYMBOL(pci_device_from_OF_node);
#endif

/* We create the "pci-OF-bus-map" property now so it appears in the
* /proc device tree
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ int pcibus_to_node(struct pci_bus *bus)
EXPORT_SYMBOL(pcibus_to_node);
#endif

#ifdef CONFIG_PPC_PMAC
int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn)
{
if (!PCI_DN(np))
Expand All @@ -294,3 +295,4 @@ int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn)
*devfn = PCI_DN(np)->devfn;
return 0;
}
#endif

0 comments on commit a2954a7

Please sign in to comment.