summaryrefslogtreecommitdiffstats
path: root/drivers/net/sk98lin/skge.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-01-07 01:57:44 +0100
committerJeff Garzik <jgarzik@pobox.com>2006-01-09 16:32:41 +0100
commitdf22b8aaba3f41cc61f57f5ead78be45edcb7db5 (patch)
tree20f40428e0a678999f90a5a1a5709b73e1d381f4 /drivers/net/sk98lin/skge.c
parent[PATCH] sk98lin: error handling on probe (diff)
downloadlinux-df22b8aaba3f41cc61f57f5ead78be45edcb7db5.tar.xz
linux-df22b8aaba3f41cc61f57f5ead78be45edcb7db5.zip
[PATCH] sk98lin: error handling of pci setup
Don't enable the pci device twice (already done in the probe routine). Propogate the error codes from pci_request_region back to initial probing. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/sk98lin/skge.c')
-rw-r--r--drivers/net/sk98lin/skge.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 455417d5fcfb..197edd74fbb5 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -292,17 +292,12 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
struct pci_dev *pdev = pAC->PciDev;
int retval;
- if (pci_enable_device(pdev) != 0) {
- return 1;
- }
-
dev->mem_start = pci_resource_start (pdev, 0);
pci_set_master(pdev);
- if (pci_request_regions(pdev, "sk98lin") != 0) {
- retval = 2;
- goto out_disable;
- }
+ retval = pci_request_regions(pdev, "sk98lin");
+ if (retval)
+ goto out;
#ifdef SK_BIG_ENDIAN
/*
@@ -321,9 +316,8 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
* Remap the regs into kernel space.
*/
pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000);
-
- if (!pAC->IoBase){
- retval = 3;
+ if (!pAC->IoBase) {
+ retval = -EIO;
goto out_release;
}
@@ -331,8 +325,7 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
out_release:
pci_release_regions(pdev);
- out_disable:
- pci_disable_device(pdev);
+ out:
return retval;
}