Commit 94ae67e9 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds

[PATCH] ibmasm: add missing pci_enable_device()

Add pci_enable_device()/pci_disable_device().  In the past, drivers often
worked without this, but it is now required in order to route PCI
interrupts correctly.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f09e59b4
......@@ -62,10 +62,17 @@ static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_
int result = -ENOMEM;
struct service_processor *sp;
if (pci_enable_device(pdev)) {
printk(KERN_ERR "%s: can't enable PCI device at %s\n",
DRIVER_NAME, pci_name(pdev));
return -ENODEV;
}
sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
if (sp == NULL) {
dev_err(&pdev->dev, "Failed to allocate memory\n");
return result;
result = -ENOMEM;
goto error_kmalloc;
}
memset(sp, 0, sizeof(struct service_processor));
......@@ -148,6 +155,8 @@ static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_
ibmasm_event_buffer_exit(sp);
error_eventbuffer:
kfree(sp);
error_kmalloc:
pci_disable_device(pdev);
return result;
}
......@@ -166,6 +175,7 @@ static void __exit ibmasm_remove_one(struct pci_dev *pdev)
iounmap(sp->base_address);
ibmasm_event_buffer_exit(sp);
kfree(sp);
pci_disable_device(pdev);
}
static struct pci_device_id ibmasm_pci_table[] =
......
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