Hello. On 21-11-2011 1:39, Gabor Juhos wrote:
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<juhosg@xxxxxxxxxxx> --- v3: - fix compile error if CONFIG_PCI is not defined - add __init annotation to ath79_register_pci
v2: - no changes
[...]
diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c index 4957428..342363b 100644 --- a/arch/mips/ath79/pci.c +++ b/arch/mips/ath79/pci.c
@@ -44,3 +46,15 @@ int pcibios_plat_dev_init(struct pci_dev *dev) return PCIBIOS_SUCCESSFUL; } + +int __init ath79_register_pci(void) +{ + int ret; + + if (soc_is_ar724x()) + ret = ath724x_pcibios_init(); + else + ret = -ENODEV;
Why not return right away and save 4 lines of code?
+ + return ret; +}
WBR, Sergei