]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/isicom.c
[PATCH] ip2: use newer pci_get functions
[linux-2.6-omap-h63xx.git] / drivers / char / isicom.c
index 478bf4d7d0659ac14922eb76adfecfcb448a6cbd..2e1da632aee18ef3c8d7ea22cc70ea06010169b5 100644 (file)
@@ -245,7 +245,7 @@ static int lock_card(struct isi_board *card)
        printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n",
                card->base);
 
-       return 0;       /* Failed to aquire the card! */
+       return 0;       /* Failed to acquire the card! */
 }
 
 static int lock_card_at_interrupt(struct isi_board *card)
@@ -262,7 +262,7 @@ static int lock_card_at_interrupt(struct isi_board *card)
                        spin_unlock_irqrestore(&card->card_lock, card->flags);
        }
        /* Failing in interrupt is an acceptable event */
-       return 0;       /* Failed to aquire the card! */
+       return 0;       /* Failed to acquire the card! */
 }
 
 static void unlock_card(struct isi_board *card)
@@ -1614,14 +1614,14 @@ static int __devinit isicom_register_isr(struct pci_dev *pdev,
        const unsigned int index)
 {
        struct isi_board *board = pci_get_drvdata(pdev);
-       unsigned long irqflags = SA_INTERRUPT;
+       unsigned long irqflags = IRQF_DISABLED;
        int retval = -EINVAL;
 
        if (!board->base)
                goto end;
 
        if (board->isa == NO)
-               irqflags |= SA_SHIRQ;
+               irqflags |= IRQF_SHARED;
 
        retval = request_irq(board->irq, isicom_interrupt, irqflags,
                ISICOM_NAME, board);
@@ -1756,9 +1756,12 @@ static int __devinit load_firmware(struct pci_dev *pdev,
        if (retval)
                goto end;
 
+       retval = -EIO;
+
        for (frame = (struct stframe *)fw->data;
                        frame < (struct stframe *)(fw->data + fw->size);
-                       frame++) {
+                       frame = (struct stframe *)((u8 *)(frame + 1) +
+                               frame->count)) {
                if (WaitTillCardIsFree(base))
                        goto errrelfw;
 
@@ -1797,23 +1800,12 @@ static int __devinit load_firmware(struct pci_dev *pdev,
                }
        }
 
-       retval = -EIO;
-
-       if (WaitTillCardIsFree(base))
-               goto errrelfw;
-
-       outw(0xf2, base);
-       outw(0x800, base);
-       outw(0x0, base);
-       outw(0x0, base);
-       InterruptTheCard(base);
-       outw(0x0, base + 0x4); /* for ISI4608 cards */
-
 /* XXX: should we test it by reading it back and comparing with original like
  * in load firmware package? */
-       for (frame = (struct stframe*)fw->data;
-                       frame < (struct stframe*)(fw->data + fw->size);
-                       frame++) {
+       for (frame = (struct stframe *)fw->data;
+                       frame < (struct stframe *)(fw->data + fw->size);
+                       frame = (struct stframe *)((u8 *)(frame + 1) +
+                               frame->count)) {
                if (WaitTillCardIsFree(base))
                        goto errrelfw;
 
@@ -1863,6 +1855,17 @@ static int __devinit load_firmware(struct pci_dev *pdev,
                }
        }
 
+       /* xfer ctrl */
+       if (WaitTillCardIsFree(base))
+               goto errrelfw;
+
+       outw(0xf2, base);
+       outw(0x800, base);
+       outw(0x0, base);
+       outw(0x0, base);
+       InterruptTheCard(base);
+       outw(0x0, base + 0x4); /* for ISI4608 cards */
+
        board->status |= FIRMWARE_LOADED;
        retval = 0;