Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6335aef5 authored by Gabor Juhos's avatar Gabor Juhos Committed by Ralf Baechle
Browse files

MIPS: ath79: add a common PCI registration function



The current code unconditionally registers the AR724X
specific PCI controller, even if the kernel is running
on a different SoC.

Add a common function for PCI controller registration,
and only register the AR724X PCI controller if the kernel
is running on an AR724X SoC.

Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3488/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 659243cc
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -111,6 +111,7 @@ static void __init ubnt_xm_init(void)
	ath724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
	ath724x_pci_add_data(ubnt_xm_pci_data, ARRAY_SIZE(ubnt_xm_pci_data));
#endif /* CONFIG_PCI */
#endif /* CONFIG_PCI */


	ath79_register_pci();
}
}


MIPS_MACHINE(ATH79_MACH_UBNT_XM,
MIPS_MACHINE(ATH79_MACH_UBNT_XM,
+10 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,8 @@
 */
 */


#include <linux/pci.h>
#include <linux/pci.h>
#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/pci.h>
#include "pci.h"
#include "pci.h"


static struct ath724x_pci_data *pci_data;
static struct ath724x_pci_data *pci_data;
@@ -44,3 +46,11 @@ int pcibios_plat_dev_init(struct pci_dev *dev)


	return PCIBIOS_SUCCESSFUL;
	return PCIBIOS_SUCCESSFUL;
}
}

int __init ath79_register_pci(void)
{
	if (soc_is_ar724x())
		return ath724x_pcibios_init();

	return -ENODEV;
}
+6 −0
Original line number Original line Diff line number Diff line
@@ -18,4 +18,10 @@ struct ath724x_pci_data {


void ath724x_pci_add_data(struct ath724x_pci_data *data, int size);
void ath724x_pci_add_data(struct ath724x_pci_data *data, int size);


#ifdef CONFIG_PCI
int ath79_register_pci(void);
#else
static inline int ath79_register_pci(void) { return 0; }
#endif

#endif /* __ASM_MACH_ATH79_PCI_ATH724X_H */
#endif /* __ASM_MACH_ATH79_PCI_ATH724X_H */
+0 −2
Original line number Original line Diff line number Diff line
@@ -137,5 +137,3 @@ int __init ath724x_pcibios_init(void)


	return PCIBIOS_SUCCESSFUL;
	return PCIBIOS_SUCCESSFUL;
}
}

arch_initcall(ath724x_pcibios_init);