]> git.itanic.dy.fi Git - linux-stable/commitdiff
powerpc/fsl_uli1575: Simplify uli_exclude_device() usage
authorPali Rohár <pali@kernel.org>
Sun, 9 Apr 2023 00:08:07 +0000 (02:08 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 20 Apr 2023 00:20:50 +0000 (10:20 +1000)
Function uli_exclude_device() is called only from mpc86xx_exclude_device()
and mpc85xx_exclude_device() functions. Both those functions are same, so
merge its logic directly into the uli_exclude_device() function.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230409000812.18904-4-pali@kernel.org
arch/powerpc/platforms/85xx/mpc85xx_ds.c
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
arch/powerpc/platforms/fsl_uli1575.c

index 0c905a8389422d31430e4e2cbc8581eab3c9a8f6..581b5f0ef3be2d411f26d0f39a460eb6dfcf1049 100644 (file)
@@ -107,17 +107,6 @@ void __init mpc85xx_ds_pic_init(void)
 #endif /* CONFIG_PPC_I8259 */
 }
 
-#ifdef CONFIG_PCI
-static int mpc85xx_exclude_device(struct pci_controller *hose,
-                                  u_char bus, u_char devfn)
-{
-       if (hose->dn == fsl_pci_primary)
-               return uli_exclude_device(hose, bus, devfn);
-
-       return PCIBIOS_SUCCESSFUL;
-}
-#endif /* CONFIG_PCI */
-
 static void __init mpc85xx_ds_uli_init(void)
 {
 #ifdef CONFIG_PCI
@@ -132,7 +121,7 @@ static void __init mpc85xx_ds_uli_init(void)
                node = pci_with_uli;
 
                if (pci_with_uli == fsl_pci_primary) {
-                       ppc_md.pci_exclude_device = mpc85xx_exclude_device;
+                       ppc_md.pci_exclude_device = uli_exclude_device;
                        break;
                }
        }
index 3dbd396a0df5481a83ff885f2a234969fb54eedf..645125cc84209adf8bd59bc795bf0f509b79bbe7 100644 (file)
 #define DBG(fmt...) do { } while(0)
 #endif
 
-#ifdef CONFIG_PCI
-static int mpc86xx_exclude_device(struct pci_controller *hose,
-                                  u_char bus, u_char devfn)
-{
-       if (hose->dn == fsl_pci_primary)
-               return uli_exclude_device(hose, bus, devfn);
-
-       return PCIBIOS_SUCCESSFUL;
-}
-#endif /* CONFIG_PCI */
-
 
 static void __init
 mpc86xx_hpcn_setup_arch(void)
@@ -58,7 +47,7 @@ mpc86xx_hpcn_setup_arch(void)
                ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-       ppc_md.pci_exclude_device = mpc86xx_exclude_device;
+       ppc_md.pci_exclude_device = uli_exclude_device;
 #endif
 
        printk("MPC86xx HPCN board from Freescale Semiconductor\n");
index a32f9cef784531f9a83e9d46d9620297ba449194..1350db0b935dd9216aeedd3e19a069ba0253ad10 100644 (file)
@@ -15,6 +15,8 @@
 #include <asm/pci-bridge.h>
 #include <asm/ppc-pci.h>
 
+#include <sysdev/fsl_pci.h>
+
 #define ULI_PIRQA      0x08
 #define ULI_PIRQB      0x09
 #define ULI_PIRQC      0x0a
@@ -344,7 +346,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, hpcd_final_uli5288);
 
 int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn)
 {
-       if (bus == (hose->first_busno + 2)) {
+       if (hose->dn == fsl_pci_primary && bus == (hose->first_busno + 2)) {
                /* exclude Modem controller */
                if ((PCI_SLOT(devfn) == 29) && (PCI_FUNC(devfn) == 1))
                        return PCIBIOS_DEVICE_NOT_FOUND;