fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / message / i2o / pci.c
index 4f1515c..3661e6e 100644 (file)
@@ -224,12 +224,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
  *     i2o_pci_interrupt - Interrupt handler for I2O controller
  *     @irq: interrupt line
  *     @dev_id: pointer to the I2O controller
- *     @r: pointer to registers
  *
  *     Handle an interrupt from a PCI based I2O controller. This turns out
  *     to be rather simple. We keep the controller pointer in the cookie.
  */
-static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r)
+static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id)
 {
        struct i2o_controller *c = dev_id;
        u32 m;
@@ -260,6 +259,7 @@ static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r)
 
 /**
  *     i2o_pci_irq_enable - Allocate interrupt for I2O controller
+ *     @c: i2o_controller that the request is for
  *
  *     Allocate an interrupt for the I2O controller, and activate interrupts
  *     on the I2O controller.
@@ -274,7 +274,7 @@ static int i2o_pci_irq_enable(struct i2o_controller *c)
        writel(0xffffffff, c->irq_mask);
 
        if (pdev->irq) {
-               rc = request_irq(pdev->irq, i2o_pci_interrupt, SA_SHIRQ,
+               rc = request_irq(pdev->irq, i2o_pci_interrupt, IRQF_SHARED,
                                 c->name, c);
                if (rc < 0) {
                        printk(KERN_ERR "%s: unable to allocate interrupt %d."
@@ -306,7 +306,7 @@ static void i2o_pci_irq_disable(struct i2o_controller *c)
 
 /**
  *     i2o_pci_probe - Probe the PCI device for an I2O controller
- *     @dev: PCI device to test
+ *     @pdev: PCI device to test
  *     @id: id which matched with the PCI device id table
  *
  *     Probe the PCI device for any device which is a memory of the
@@ -321,7 +321,6 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
        struct i2o_controller *c;
        int rc;
        struct pci_dev *i960 = NULL;
-       int enabled = pdev->is_enabled;
 
        printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");
 
@@ -331,12 +330,11 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
                return -ENODEV;
        }
 
-       if (!enabled)
-               if ((rc = pci_enable_device(pdev))) {
-                       printk(KERN_WARNING "i2o: couldn't enable device %s\n",
-                              pci_name(pdev));
-                       return rc;
-               }
+       if ((rc = pci_enable_device(pdev))) {
+               printk(KERN_WARNING "i2o: couldn't enable device %s\n",
+                      pci_name(pdev));
+               return rc;
+       }
 
        if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                printk(KERN_WARNING "i2o: no suitable DMA found for %s\n",
@@ -372,12 +370,13 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
                 * Expose the ship behind i960 for initialization, or it will
                 * failed
                 */
-               i960 =
-                   pci_find_slot(c->pdev->bus->number,
+               i960 = pci_get_slot(c->pdev->bus,
                                  PCI_DEVFN(PCI_SLOT(c->pdev->devfn), 0));
 
-               if (i960)
+               if (i960) {
                        pci_write_config_word(i960, 0x42, 0);
+                       pci_dev_put(i960);
+               }
 
                c->promise = 1;
                c->limit_sectors = 1;
@@ -442,15 +441,14 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
        i2o_iop_free(c);
 
       disable:
-       if (!enabled)
-               pci_disable_device(pdev);
+       pci_disable_device(pdev);
 
        return rc;
 }
 
 /**
  *     i2o_pci_remove - Removes a I2O controller from the system
- *     pdev: I2O controller which should be removed
+ *     @pdev: I2O controller which should be removed
  *
  *     Reset the I2O controller, disable interrupts and remove all allocated
  *     resources.