Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Stephen Hemminger and committed by
Jeff Garzik
df22b8aa 16287557

+6 -13
+6 -13
drivers/net/sk98lin/skge.c
··· 292 292 struct pci_dev *pdev = pAC->PciDev; 293 293 int retval; 294 294 295 - if (pci_enable_device(pdev) != 0) { 296 - return 1; 297 - } 298 - 299 295 dev->mem_start = pci_resource_start (pdev, 0); 300 296 pci_set_master(pdev); 301 297 302 - if (pci_request_regions(pdev, "sk98lin") != 0) { 303 - retval = 2; 304 - goto out_disable; 305 - } 298 + retval = pci_request_regions(pdev, "sk98lin"); 299 + if (retval) 300 + goto out; 306 301 307 302 #ifdef SK_BIG_ENDIAN 308 303 /* ··· 316 321 * Remap the regs into kernel space. 317 322 */ 318 323 pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000); 319 - 320 - if (!pAC->IoBase){ 321 - retval = 3; 324 + if (!pAC->IoBase) { 325 + retval = -EIO; 322 326 goto out_release; 323 327 } 324 328 ··· 325 331 326 332 out_release: 327 333 pci_release_regions(pdev); 328 - out_disable: 329 - pci_disable_device(pdev); 334 + out: 330 335 return retval; 331 336 } 332 337