]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/char/isicom.c
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
[mirror_ubuntu-artful-kernel.git] / drivers / char / isicom.c
index e9ebabaf8cb03184e9990ea272cc91fa733f6a21..e9e9bf31c369ef9b8b96cd3f65ac463647b7af69 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)
@@ -546,7 +546,7 @@ static void isicom_bottomhalf(void *data)
  *     Main interrupt handler routine
  */
 
-static irqreturn_t isicom_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t isicom_interrupt(int irq, void *dev_id)
 {
        struct isi_board *card = dev_id;
        struct isi_port *port;
@@ -1145,7 +1145,7 @@ static int isicom_write(struct tty_struct *tty,   const unsigned char *buf,
        if (isicom_paranoia_check(port, tty->name, "isicom_write"))
                return 0;
 
-       if (!tty || !port->xmit_buf)
+       if (!port->xmit_buf)
                return 0;
 
        spin_lock_irqsave(&card->card_lock, flags);
@@ -1180,7 +1180,7 @@ static void isicom_put_char(struct tty_struct *tty, unsigned char ch)
        if (isicom_paranoia_check(port, tty->name, "isicom_put_char"))
                return;
 
-       if (!tty || !port->xmit_buf)
+       if (!port->xmit_buf)
                return;
 
        spin_lock_irqsave(&card->card_lock, flags);
@@ -1550,7 +1550,7 @@ static void isicom_unregister_ioregion(struct pci_dev *pdev)
        board->base = 0;
 }
 
-static struct tty_operations isicom_ops = {
+static const struct tty_operations isicom_ops = {
        .open                   = isicom_open,
        .close                  = isicom_close,
        .write                  = isicom_write,
@@ -1581,7 +1581,6 @@ static int __devinit isicom_register_tty_driver(void)
 
        isicom_normal->owner                    = THIS_MODULE;
        isicom_normal->name                     = "ttyM";
-       isicom_normal->devfs_name               = "isicom/";
        isicom_normal->major                    = ISICOM_NMAJOR;
        isicom_normal->minor_start              = 0;
        isicom_normal->type                     = TTY_DRIVER_TYPE_SERIAL;
@@ -1615,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);
@@ -1757,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;
 
@@ -1798,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;
 
@@ -1864,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;