Commit df22b8aa authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 16287557
...@@ -292,17 +292,12 @@ static __devinit int SkGeInitPCI(SK_AC *pAC) ...@@ -292,17 +292,12 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
struct pci_dev *pdev = pAC->PciDev; struct pci_dev *pdev = pAC->PciDev;
int retval; int retval;
if (pci_enable_device(pdev) != 0) {
return 1;
}
dev->mem_start = pci_resource_start (pdev, 0); dev->mem_start = pci_resource_start (pdev, 0);
pci_set_master(pdev); pci_set_master(pdev);
if (pci_request_regions(pdev, "sk98lin") != 0) { retval = pci_request_regions(pdev, "sk98lin");
retval = 2; if (retval)
goto out_disable; goto out;
}
#ifdef SK_BIG_ENDIAN #ifdef SK_BIG_ENDIAN
/* /*
...@@ -321,9 +316,8 @@ static __devinit int SkGeInitPCI(SK_AC *pAC) ...@@ -321,9 +316,8 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
* Remap the regs into kernel space. * Remap the regs into kernel space.
*/ */
pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000); pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000);
if (!pAC->IoBase) {
if (!pAC->IoBase){ retval = -EIO;
retval = 3;
goto out_release; goto out_release;
} }
...@@ -331,8 +325,7 @@ static __devinit int SkGeInitPCI(SK_AC *pAC) ...@@ -331,8 +325,7 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
out_release: out_release:
pci_release_regions(pdev); pci_release_regions(pdev);
out_disable: out:
pci_disable_device(pdev);
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment