aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-03-18 19:19:03 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-03-18 19:19:03 +0000
commit3c75de37a81f69021085dab34981e9adf6554667 (patch)
treede24e6c4211473480bc1786bec04779751170ecf /target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
parent11f888b68ea18bec4c98809e27cc95e9b3c52fb4 (diff)
downloadupstream-3c75de37a81f69021085dab34981e9adf6554667.tar.gz
upstream-3c75de37a81f69021085dab34981e9adf6554667.tar.bz2
upstream-3c75de37a81f69021085dab34981e9adf6554667.zip
ar71xx: add error handling to ar724x_pcibios_init
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20283 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c')
-rw-r--r--target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
index 9d37561aa0..251bf6d390 100644
--- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
+++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
@@ -356,22 +356,33 @@ static void __init ar724x_pci_irq_init(void)
int __init ar724x_pcibios_init(void)
{
- int ret;
+ int ret = -ENOMEM;
ar724x_pci_localcfg_base = ioremap_nocache(AR724X_PCI_CRP_BASE,
AR724X_PCI_CRP_SIZE);
+ if (ar724x_pci_localcfg_base == NULL)
+ goto err;
ar724x_pci_devcfg_base = ioremap_nocache(AR724X_PCI_CFG_BASE,
AR724X_PCI_CFG_SIZE);
+ if (ar724x_pci_devcfg_base == NULL)
+ goto err_unmap_localcfg;
ar724x_pci_reset();
ret = ar724x_pci_setup();
if (ret)
- return ret;
+ goto err_unmap_devcfg;
ar724x_pci_fixup_enable = 1;
ar724x_pci_irq_init();
register_pci_controller(&ar724x_pci_controller);
return 0;
+
+ err_unmap_devcfg:
+ iounmap(ar724x_pci_devcfg_base);
+ err_unmap_localcfg:
+ iounmap(ar724x_pci_localcfg_base);
+ err:
+ return ret;
}