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_ ...@@ -62,10 +62,17 @@ static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_
int result = -ENOMEM; int result = -ENOMEM;
struct service_processor *sp; 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); sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
if (sp == NULL) { if (sp == NULL) {
dev_err(&pdev->dev, "Failed to allocate memory\n"); dev_err(&pdev->dev, "Failed to allocate memory\n");
return result; result = -ENOMEM;
goto error_kmalloc;
} }
memset(sp, 0, sizeof(struct service_processor)); 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_ ...@@ -148,6 +155,8 @@ static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_
ibmasm_event_buffer_exit(sp); ibmasm_event_buffer_exit(sp);
error_eventbuffer: error_eventbuffer:
kfree(sp); kfree(sp);
error_kmalloc:
pci_disable_device(pdev);
return result; return result;
} }
...@@ -166,6 +175,7 @@ static void __exit ibmasm_remove_one(struct pci_dev *pdev) ...@@ -166,6 +175,7 @@ static void __exit ibmasm_remove_one(struct pci_dev *pdev)
iounmap(sp->base_address); iounmap(sp->base_address);
ibmasm_event_buffer_exit(sp); ibmasm_event_buffer_exit(sp);
kfree(sp); kfree(sp);
pci_disable_device(pdev);
} }
static struct pci_device_id ibmasm_pci_table[] = 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