From 6335aef59c55f50e6d8017a28c0ee985b533ea29 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Wed, 14 Mar 2012 10:29:24 +0100 Subject: 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: Gabor Juhos Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3488/ Signed-off-by: Ralf Baechle --- arch/mips/ath79/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/mips/ath79/pci.c') diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c index 49574284b755..855a69dcc86e 100644 --- a/arch/mips/ath79/pci.c +++ b/arch/mips/ath79/pci.c @@ -9,6 +9,8 @@ */ #include +#include +#include #include "pci.h" static struct ath724x_pci_data *pci_data; @@ -44,3 +46,11 @@ int pcibios_plat_dev_init(struct pci_dev *dev) return PCIBIOS_SUCCESSFUL; } + +int __init ath79_register_pci(void) +{ + if (soc_is_ar724x()) + return ath724x_pcibios_init(); + + return -ENODEV; +} -- cgit v1.2.3