Commit 4fd09f90 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman

staging: spectra: call disable_pci_device() if pci_probe() failed

Driver should call disable_pci_device() if it returns from pci_probe()
with error.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent beef9697
...@@ -2411,13 +2411,15 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -2411,13 +2411,15 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
csr_base = pci_resource_start(dev, 0); csr_base = pci_resource_start(dev, 0);
if (!csr_base) { if (!csr_base) {
printk(KERN_ERR "Spectra: pci_resource_start failed!\n"); printk(KERN_ERR "Spectra: pci_resource_start failed!\n");
return -ENODEV; ret = -ENODEV;
goto failed_req_csr;
} }
csr_len = pci_resource_len(dev, 0); csr_len = pci_resource_len(dev, 0);
if (!csr_len) { if (!csr_len) {
printk(KERN_ERR "Spectra: pci_resource_len failed!\n"); printk(KERN_ERR "Spectra: pci_resource_len failed!\n");
return -ENODEV; ret = -ENODEV;
goto failed_req_csr;
} }
ret = pci_request_regions(dev, SPECTRA_NAND_NAME); ret = pci_request_regions(dev, SPECTRA_NAND_NAME);
...@@ -2464,6 +2466,7 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -2464,6 +2466,7 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
failed_remap_csr: failed_remap_csr:
pci_release_regions(dev); pci_release_regions(dev);
failed_req_csr: failed_req_csr:
pci_disable_device(dev);
return ret; return ret;
} }
......
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