aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sk98lin
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-01-06 19:57:44 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-09 10:32:41 -0500
commitdf22b8aaba3f41cc61f57f5ead78be45edcb7db5 (patch)
tree20f40428e0a678999f90a5a1a5709b73e1d381f4 /drivers/net/sk98lin
parent162875570e65b56a7f4d804fc32aebf7a434cf89 (diff)
[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')
-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)
292 struct pci_dev *pdev = pAC->PciDev; 292 struct pci_dev *pdev = pAC->PciDev;
293 int retval; 293 int retval;
294 294
295 if (pci_enable_device(pdev) != 0) {
296 return 1;
297 }
298
299 dev->mem_start = pci_resource_start (pdev, 0); 295 dev->mem_start = pci_resource_start (pdev, 0);
300 pci_set_master(pdev); 296 pci_set_master(pdev);
301 297
302 if (pci_request_regions(pdev, "sk98lin") != 0) { 298 retval = pci_request_regions(pdev, "sk98lin");
303 retval = 2; 299 if (retval)
304 goto out_disable; 300 goto out;
305 }
306 301
307#ifdef SK_BIG_ENDIAN 302#ifdef SK_BIG_ENDIAN
308 /* 303 /*
@@ -321,9 +316,8 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
321 * Remap the regs into kernel space. 316 * Remap the regs into kernel space.
322 */ 317 */
323 pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000); 318 pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000);
324 319 if (!pAC->IoBase) {
325 if (!pAC->IoBase){ 320 retval = -EIO;
326 retval = 3;
327 goto out_release; 321 goto out_release;
328 } 322 }
329 323
@@ -331,8 +325,7 @@ static __devinit int SkGeInitPCI(SK_AC *pAC)
331 325
332 out_release: 326 out_release:
333 pci_release_regions(pdev); 327 pci_release_regions(pdev);
334 out_disable: 328 out:
335 pci_disable_device(pdev);
336 return retval; 329 return retval;
337} 330}
338 331