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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 62f1ac08332c..3661e6e065d2 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -259,6 +259,7 @@ static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id)
259 259
260/** 260/**
261 * i2o_pci_irq_enable - Allocate interrupt for I2O controller 261 * i2o_pci_irq_enable - Allocate interrupt for I2O controller
262 * @c: i2o_controller that the request is for
262 * 263 *
263 * Allocate an interrupt for the I2O controller, and activate interrupts 264 * Allocate an interrupt for the I2O controller, and activate interrupts
264 * on the I2O controller. 265 * on the I2O controller.
@@ -305,7 +306,7 @@ static void i2o_pci_irq_disable(struct i2o_controller *c)
305 306
306/** 307/**
307 * i2o_pci_probe - Probe the PCI device for an I2O controller 308 * i2o_pci_probe - Probe the PCI device for an I2O controller
308 * @dev: PCI device to test 309 * @pdev: PCI device to test
309 * @id: id which matched with the PCI device id table 310 * @id: id which matched with the PCI device id table
310 * 311 *
311 * Probe the PCI device for any device which is a memory of the 312 * Probe the PCI device for any device which is a memory of the
@@ -320,7 +321,6 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
320 struct i2o_controller *c; 321 struct i2o_controller *c;
321 int rc; 322 int rc;
322 struct pci_dev *i960 = NULL; 323 struct pci_dev *i960 = NULL;
323 int enabled = pdev->is_enabled;
324 324
325 printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); 325 printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");
326 326
@@ -330,12 +330,11 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
330 return -ENODEV; 330 return -ENODEV;
331 } 331 }
332 332
333 if (!enabled) 333 if ((rc = pci_enable_device(pdev))) {
334 if ((rc = pci_enable_device(pdev))) { 334 printk(KERN_WARNING "i2o: couldn't enable device %s\n",
335 printk(KERN_WARNING "i2o: couldn't enable device %s\n", 335 pci_name(pdev));
336 pci_name(pdev)); 336 return rc;
337 return rc; 337 }
338 }
339 338
340 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 339 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
341 printk(KERN_WARNING "i2o: no suitable DMA found for %s\n", 340 printk(KERN_WARNING "i2o: no suitable DMA found for %s\n",
@@ -442,15 +441,14 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
442 i2o_iop_free(c); 441 i2o_iop_free(c);
443 442
444 disable: 443 disable:
445 if (!enabled) 444 pci_disable_device(pdev);
446 pci_disable_device(pdev);
447 445
448 return rc; 446 return rc;
449} 447}
450 448
451/** 449/**
452 * i2o_pci_remove - Removes a I2O controller from the system 450 * i2o_pci_remove - Removes a I2O controller from the system
453 * pdev: I2O controller which should be removed 451 * @pdev: I2O controller which should be removed
454 * 452 *
455 * Reset the I2O controller, disable interrupts and remove all allocated 453 * Reset the I2O controller, disable interrupts and remove all allocated
456 * resources. 454 * resources.