aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/i2o/pci.c')
-rw-r--r--drivers/message/i2o/pci.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 7a60fd7be8ad..66c03e882570 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -32,6 +32,8 @@
32#include <linux/i2o.h> 32#include <linux/i2o.h>
33#include "core.h" 33#include "core.h"
34 34
35#define OSM_DESCRIPTION "I2O-subsystem"
36
35/* PCI device id table for all I2O controllers */ 37/* PCI device id table for all I2O controllers */
36static struct pci_device_id __devinitdata i2o_pci_ids[] = { 38static struct pci_device_id __devinitdata i2o_pci_ids[] = {
37 {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, 39 {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)},
@@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c)
66 68
67 if (c->base.virt) 69 if (c->base.virt)
68 iounmap(c->base.virt); 70 iounmap(c->base.virt);
71
72 pci_release_regions(c->pdev);
69} 73}
70 74
71/** 75/**
@@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
84 struct device *dev = &pdev->dev; 88 struct device *dev = &pdev->dev;
85 int i; 89 int i;
86 90
91 if (pci_request_regions(pdev, OSM_DESCRIPTION)) {
92 printk(KERN_ERR "%s: device already claimed\n", c->name);
93 return -ENODEV;
94 }
95
87 for (i = 0; i < 6; i++) { 96 for (i = 0; i < 6; i++) {
88 /* Skip I/O spaces */ 97 /* Skip I/O spaces */
89 if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { 98 if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
@@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
138 c->base.virt = ioremap_nocache(c->base.phys, c->base.len); 147 c->base.virt = ioremap_nocache(c->base.phys, c->base.len);
139 if (!c->base.virt) { 148 if (!c->base.virt) {
140 printk(KERN_ERR "%s: Unable to map controller.\n", c->name); 149 printk(KERN_ERR "%s: Unable to map controller.\n", c->name);
150 i2o_pci_free(c);
141 return -ENOMEM; 151 return -ENOMEM;
142 } 152 }
143 153