lkml.org 
[lkml]   [2004]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ibmasm: add missing pci_enable_device()
Date
I don't have this hardware, so this has not been tested.


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: Bjorn Helgaas <bjorn.helgaas@hp.com>

===== drivers/misc/ibmasm/module.c 1.2 vs edited =====
--- 1.2/drivers/misc/ibmasm/module.c 2004-05-14 06:00:50 -06:00
+++ edited/drivers/misc/ibmasm/module.c 2004-08-04 13:15:46 -06:00
@@ -62,10 +62,17 @@
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 @@
ibmasm_event_buffer_exit(sp);
error_eventbuffer:
kfree(sp);
+error_kmalloc:
+ pci_disable_device(pdev);

return result;
}
@@ -166,6 +175,7 @@
iounmap(sp->base_address);
ibmasm_event_buffer_exit(sp);
kfree(sp);
+ pci_disable_device(pdev);
}

static struct pci_device_id ibmasm_pci_table[] =
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.362 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site