Commit d8cc66f8 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] PCI: propagate pci_enable_device() errors

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

Jeff Garzik pointed out that I should have propagated the error returned
from pci_enable_device() rather than making up -ENODEV.

Propagate pci_enable_device() error returns rather than using -ENODEV.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 19e2d758
......@@ -3685,9 +3685,9 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
int i, err;
if (pci_enable_device(pcidev)) {
if ((err = pci_enable_device(pcidev))) {
printk("idt77252: can't enable PCI device at %s\n", pci_name(pcidev));
return -ENODEV;
return err;
}
if (pci_read_config_word(pcidev, PCI_REVISION_ID, &revision)) {
......
......@@ -88,10 +88,10 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id
tpam_card *card, *c;
int i, err;
if (pci_enable_device(dev)) {
if ((err = pci_enable_device(dev))) {
printk(KERN_ERR "TurboPAM: can't enable PCI device at %s\n",
pci_name(dev));
return -ENODEV;
return err;
}
/* allocate memory for the board structure */
......
......@@ -59,13 +59,13 @@
static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{
int result = -ENOMEM;
int err, result = -ENOMEM;
struct service_processor *sp;
if (pci_enable_device(pdev)) {
if ((err = pci_enable_device(pdev))) {
printk(KERN_ERR "%s: can't enable PCI device at %s\n",
DRIVER_NAME, pci_name(pdev));
return -ENODEV;
return err;
}
sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
......
......@@ -2242,8 +2242,8 @@ static int __devinit de4x5_pci_probe (struct pci_dev *pdev,
return -ENODEV;
/* Ok, the device seems to be for us. */
if (pci_enable_device (pdev))
return -ENODEV;
if ((error = pci_enable_device (pdev)))
return error;
if (!(dev = alloc_etherdev (sizeof (struct de4x5_private)))) {
error = -ENOMEM;
......
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