Commit 821b3a47 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/fsl_uli1575: Misc cleanup

Use a single line for uli_exclude_device().

Add uli_exclude_device() prototype in ppc-pci.h and guard it.

Remove that prototype from mpc85xx_ds.c and mpc86xx_hpcn.c files.

Make uli_pirq_to_irq[] static as it is used only in that file.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarPali Rohár <pali@kernel.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230409000812.18904-2-pali@kernel.org
parent 648a1783
...@@ -57,11 +57,20 @@ void eeh_sysfs_remove_device(struct pci_dev *pdev); ...@@ -57,11 +57,20 @@ void eeh_sysfs_remove_device(struct pci_dev *pdev);
#endif /* CONFIG_EEH */ #endif /* CONFIG_EEH */
#ifdef CONFIG_FSL_ULI1575
int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn);
#endif /* CONFIG_FSL_ULI1575 */
#define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff) #define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff)
#else /* CONFIG_PCI */ #else /* CONFIG_PCI */
static inline void init_pci_config_tokens(void) { } static inline void init_pci_config_tokens(void) { }
#endif /* !CONFIG_PCI */ #endif /* !CONFIG_PCI */
#if !defined(CONFIG_PCI) || !defined(CONFIG_FSL_ULI1575)
#include <linux/pci.h>
static inline int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) { return PCIBIOS_SUCCESSFUL; }
#endif /* !defined(CONFIG_PCI) || !defined(CONFIG_FSL_ULI1575) */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PPC_PCI_H */ #endif /* _ASM_POWERPC_PPC_PCI_H */
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <asm/mpic.h> #include <asm/mpic.h>
#include <asm/i8259.h> #include <asm/i8259.h>
#include <asm/swiotlb.h> #include <asm/swiotlb.h>
#include <asm/ppc-pci.h>
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h> #include <sysdev/fsl_pci.h>
...@@ -107,9 +108,6 @@ void __init mpc85xx_ds_pic_init(void) ...@@ -107,9 +108,6 @@ void __init mpc85xx_ds_pic_init(void)
} }
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
extern int uli_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn);
static struct device_node *pci_with_uli; static struct device_node *pci_with_uli;
static int mpc85xx_exclude_device(struct pci_controller *hose, static int mpc85xx_exclude_device(struct pci_controller *hose,
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <mm/mmu_decl.h> #include <mm/mmu_decl.h>
#include <asm/udbg.h> #include <asm/udbg.h>
#include <asm/swiotlb.h> #include <asm/swiotlb.h>
#include <asm/ppc-pci.h>
#include <asm/mpic.h> #include <asm/mpic.h>
...@@ -39,9 +40,6 @@ ...@@ -39,9 +40,6 @@
#endif #endif
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
extern int uli_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn);
static int mpc86xx_exclude_device(struct pci_controller *hose, static int mpc86xx_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn) u_char bus, u_char devfn)
{ {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/ppc-pci.h>
#define ULI_PIRQA 0x08 #define ULI_PIRQA 0x08
#define ULI_PIRQB 0x09 #define ULI_PIRQB 0x09
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
#define ULI_8259_IRQ14 0x0d #define ULI_8259_IRQ14 0x0d
#define ULI_8259_IRQ15 0x0f #define ULI_8259_IRQ15 0x0f
u8 uli_pirq_to_irq[8] = { static u8 uli_pirq_to_irq[8] = {
ULI_8259_IRQ9, /* PIRQA */ ULI_8259_IRQ9, /* PIRQA */
ULI_8259_IRQ10, /* PIRQB */ ULI_8259_IRQ10, /* PIRQB */
ULI_8259_IRQ11, /* PIRQC */ ULI_8259_IRQ11, /* PIRQC */
...@@ -341,8 +342,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, hpcd_quirk_uli5288); ...@@ -341,8 +342,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, hpcd_quirk_uli5288);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, hpcd_quirk_uli5229); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, hpcd_quirk_uli5229);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, hpcd_final_uli5288); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, hpcd_final_uli5288);
int uli_exclude_device(struct pci_controller *hose, int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn)
u_char bus, u_char devfn)
{ {
if (bus == (hose->first_busno + 2)) { if (bus == (hose->first_busno + 2)) {
/* exclude Modem controller */ /* exclude Modem controller */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment