]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/stallion.c
[PATCH] Char: stallion, remove unneeded casts
[mv-sheeva.git] / drivers / char / stallion.c
index ed7b8eaf0367416c0675d93832a52b9469531196..6a6e5124a5fa9fea293f17ef6e8628615470bda4 100644 (file)
@@ -187,32 +187,32 @@ static stlbrd_t           *stl_brds[STL_MAXBRDS];
  *     referencing boards when printing trace and stuff.
  */
 static char    *stl_brdnames[] = {
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
        "EasyIO",
        "EC8/32-AT",
        "EC8/32-MC",
-       (char *) NULL,
-       (char *) NULL,
-       (char *) NULL,
+       NULL,
+       NULL,
+       NULL,
        "EC8/32-PCI",
        "EC8/64-PCI",
        "EasyIO-PCI",
@@ -500,7 +500,7 @@ static int  stl_echatintr(stlbrd_t *brdp);
 static int     stl_echmcaintr(stlbrd_t *brdp);
 static int     stl_echpciintr(stlbrd_t *brdp);
 static int     stl_echpci64intr(stlbrd_t *brdp);
-static void    stl_offintr(void *private);
+static void    stl_offintr(struct work_struct *);
 static stlbrd_t *stl_allocbrd(void);
 static stlport_t *stl_getport(int brdnr, int panelnr, int portnr);
 
@@ -707,7 +707,7 @@ static unsigned int sc26198_baudtable[] = {
  *     Define the driver info for a user level control device. Used mainly
  *     to get at port stats - only not using the port device itself.
  */
-static struct file_operations  stl_fsiomem = {
+static const struct file_operations    stl_fsiomem = {
        .owner          = THIS_MODULE,
        .ioctl          = stl_memioctl,
 };
@@ -735,9 +735,7 @@ static void __exit stallion_module_exit(void)
        stlport_t       *portp;
        int             i, j, k;
 
-#ifdef DEBUG
-       printk("cleanup_module()\n");
-#endif
+       pr_debug("cleanup_module()\n");
 
        printk(KERN_INFO "Unloading %s: version %s\n", stl_drvtitle,
                stl_drvversion);
@@ -763,20 +761,20 @@ static void __exit stallion_module_exit(void)
        class_destroy(stallion_class);
 
        for (i = 0; (i < stl_nrbrds); i++) {
-               if ((brdp = stl_brds[i]) == (stlbrd_t *) NULL)
+               if ((brdp = stl_brds[i]) == NULL)
                        continue;
 
                free_irq(brdp->irq, brdp);
 
                for (j = 0; (j < STL_MAXPANELS); j++) {
                        panelp = brdp->panels[j];
-                       if (panelp == (stlpanel_t *) NULL)
+                       if (panelp == NULL)
                                continue;
                        for (k = 0; (k < STL_PORTSPERPANEL); k++) {
                                portp = panelp->ports[k];
-                               if (portp == (stlport_t *) NULL)
+                               if (portp == NULL)
                                        continue;
-                               if (portp->tty != (struct tty_struct *) NULL)
+                               if (portp->tty != NULL)
                                        stl_hangup(portp->tty);
                                kfree(portp->tx.buf);
                                kfree(portp);
@@ -789,7 +787,7 @@ static void __exit stallion_module_exit(void)
                        release_region(brdp->ioaddr2, brdp->iosize2);
 
                kfree(brdp);
-               stl_brds[i] = (stlbrd_t *) NULL;
+               stl_brds[i] = NULL;
        }
 }
 
@@ -808,15 +806,13 @@ static void stl_argbrds(void)
        stlbrd_t        *brdp;
        int             i;
 
-#ifdef DEBUG
-       printk("stl_argbrds()\n");
-#endif
+       pr_debug("stl_argbrds()\n");
 
        for (i = stl_nrbrds; (i < stl_nargs); i++) {
                memset(&conf, 0, sizeof(conf));
                if (stl_parsebrd(&conf, stl_brdsp[i]) == 0)
                        continue;
-               if ((brdp = stl_allocbrd()) == (stlbrd_t *) NULL)
+               if ((brdp = stl_allocbrd()) == NULL)
                        continue;
                stl_nrbrds = i + 1;
                brdp->brdnr = i;
@@ -876,11 +872,9 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
        char    *sp;
        int     i;
 
-#ifdef DEBUG
-       printk("stl_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
-#endif
+       pr_debug("stl_parsebrd(confp=%p,argp=%p)\n", confp, argp);
 
-       if ((argp[0] == (char *) NULL) || (*argp[0] == 0))
+       if ((argp[0] == NULL) || (*argp[0] == 0))
                return 0;
 
        for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++)
@@ -898,15 +892,15 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
        confp->brdtype = stl_brdstr[i].type;
 
        i = 1;
-       if ((argp[i] != (char *) NULL) && (*argp[i] != 0))
+       if ((argp[i] != NULL) && (*argp[i] != 0))
                confp->ioaddr1 = stl_atol(argp[i]);
        i++;
        if (confp->brdtype == BRD_ECH) {
-               if ((argp[i] != (char *) NULL) && (*argp[i] != 0))
+               if ((argp[i] != NULL) && (*argp[i] != 0))
                        confp->ioaddr2 = stl_atol(argp[i]);
                i++;
        }
-       if ((argp[i] != (char *) NULL) && (*argp[i] != 0))
+       if ((argp[i] != NULL) && (*argp[i] != 0))
                confp->irq = stl_atol(argp[i]);
        return 1;
 }
@@ -941,21 +935,18 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
        unsigned int    minordev;
        int             brdnr, panelnr, portnr, rc;
 
-#ifdef DEBUG
-       printk("stl_open(tty=%x,filp=%x): device=%s\n", (int) tty,
-               (int) filp, tty->name);
-#endif
+       pr_debug("stl_open(tty=%p,filp=%p): device=%s\n", tty, filp, tty->name);
 
        minordev = tty->index;
        brdnr = MINOR2BRD(minordev);
        if (brdnr >= stl_nrbrds)
                return -ENODEV;
        brdp = stl_brds[brdnr];
-       if (brdp == (stlbrd_t *) NULL)
+       if (brdp == NULL)
                return -ENODEV;
        minordev = MINOR2PORT(minordev);
        for (portnr = -1, panelnr = 0; (panelnr < STL_MAXPANELS); panelnr++) {
-               if (brdp->panels[panelnr] == (stlpanel_t *) NULL)
+               if (brdp->panels[panelnr] == NULL)
                        break;
                if (minordev < brdp->panels[panelnr]->nrports) {
                        portnr = minordev;
@@ -967,7 +958,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
                return -ENODEV;
 
        portp = brdp->panels[panelnr]->ports[portnr];
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return -ENODEV;
 
 /*
@@ -1034,9 +1025,7 @@ static int stl_waitcarrier(stlport_t *portp, struct file *filp)
        unsigned long   flags;
        int             rc, doclocal;
 
-#ifdef DEBUG
-       printk("stl_waitcarrier(portp=%x,filp=%x)\n", (int) portp, (int) filp);
-#endif
+       pr_debug("stl_waitcarrier(portp=%p,filp=%p)\n", portp, filp);
 
        rc = 0;
        doclocal = 0;
@@ -1088,12 +1077,10 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
        stlport_t       *portp;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_close(tty=%x,filp=%x)\n", (int) tty, (int) filp);
-#endif
+       pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp);
 
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        spin_lock_irqsave(&stallion_lock, flags);
@@ -1136,17 +1123,17 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
        stl_enablerxtx(portp, 0, 0);
        stl_flushbuffer(tty);
        portp->istate = 0;
-       if (portp->tx.buf != (char *) NULL) {
+       if (portp->tx.buf != NULL) {
                kfree(portp->tx.buf);
-               portp->tx.buf = (char *) NULL;
-               portp->tx.head = (char *) NULL;
-               portp->tx.tail = (char *) NULL;
+               portp->tx.buf = NULL;
+               portp->tx.head = NULL;
+               portp->tx.tail = NULL;
        }
        set_bit(TTY_IO_ERROR, &tty->flags);
        tty_ldisc_flush(tty);
 
        tty->closing = 0;
-       portp->tty = (struct tty_struct *) NULL;
+       portp->tty = NULL;
 
        if (portp->openwaitcnt) {
                if (portp->close_delay)
@@ -1172,15 +1159,12 @@ static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count
        unsigned char   *chbuf;
        char            *head, *tail;
 
-#ifdef DEBUG
-       printk("stl_write(tty=%x,buf=%x,count=%d)\n",
-               (int) tty, (int) buf, count);
-#endif
+       pr_debug("stl_write(tty=%p,buf=%p,count=%d)\n", tty, buf, count);
 
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return 0;
-       if (portp->tx.buf == (char *) NULL)
+       if (portp->tx.buf == NULL)
                return 0;
 
 /*
@@ -1231,16 +1215,14 @@ static void stl_putchar(struct tty_struct *tty, unsigned char ch)
        unsigned int    len;
        char            *head, *tail;
 
-#ifdef DEBUG
-       printk("stl_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch);
-#endif
+       pr_debug("stl_putchar(tty=%p,ch=%x)\n", tty, ch);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
-       if (portp->tx.buf == (char *) NULL)
+       if (portp->tx.buf == NULL)
                return;
 
        head = portp->tx.head;
@@ -1269,16 +1251,14 @@ static void stl_flushchars(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_flushchars(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_flushchars(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
-       if (portp->tx.buf == (char *) NULL)
+       if (portp->tx.buf == NULL)
                return;
 
        stl_startrxtx(portp, -1, 1);
@@ -1291,16 +1271,14 @@ static int stl_writeroom(struct tty_struct *tty)
        stlport_t       *portp;
        char            *head, *tail;
 
-#ifdef DEBUG
-       printk("stl_writeroom(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_writeroom(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return 0;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return 0;
-       if (portp->tx.buf == (char *) NULL)
+       if (portp->tx.buf == NULL)
                return 0;
 
        head = portp->tx.head;
@@ -1325,16 +1303,14 @@ static int stl_charsinbuffer(struct tty_struct *tty)
        unsigned int    size;
        char            *head, *tail;
 
-#ifdef DEBUG
-       printk("stl_charsinbuffer(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_charsinbuffer(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return 0;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return 0;
-       if (portp->tx.buf == (char *) NULL)
+       if (portp->tx.buf == NULL)
                return 0;
 
        head = portp->tx.head;
@@ -1356,9 +1332,7 @@ static int stl_getserial(stlport_t *portp, struct serial_struct __user *sp)
        struct serial_struct    sio;
        stlbrd_t                *brdp;
 
-#ifdef DEBUG
-       printk("stl_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
-#endif
+       pr_debug("stl_getserial(portp=%p,sp=%p)\n", portp, sp);
 
        memset(&sio, 0, sizeof(struct serial_struct));
        sio.line = portp->portnr;
@@ -1378,7 +1352,7 @@ static int stl_getserial(stlport_t *portp, struct serial_struct __user *sp)
        }
 
        brdp = stl_brds[portp->brdnr];
-       if (brdp != (stlbrd_t *) NULL)
+       if (brdp != NULL)
                sio.irq = brdp->irq;
 
        return copy_to_user(sp, &sio, sizeof(struct serial_struct)) ? -EFAULT : 0;
@@ -1396,9 +1370,7 @@ static int stl_setserial(stlport_t *portp, struct serial_struct __user *sp)
 {
        struct serial_struct    sio;
 
-#ifdef DEBUG
-       printk("stl_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
-#endif
+       pr_debug("stl_setserial(portp=%p,sp=%p)\n", portp, sp);
 
        if (copy_from_user(&sio, sp, sizeof(struct serial_struct)))
                return -EFAULT;
@@ -1426,10 +1398,10 @@ static int stl_tiocmget(struct tty_struct *tty, struct file *file)
 {
        stlport_t       *portp;
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return -ENODEV;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return -ENODEV;
        if (tty->flags & (1 << TTY_IO_ERROR))
                return -EIO;
@@ -1443,10 +1415,10 @@ static int stl_tiocmset(struct tty_struct *tty, struct file *file,
        stlport_t       *portp;
        int rts = -1, dtr = -1;
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return -ENODEV;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return -ENODEV;
        if (tty->flags & (1 << TTY_IO_ERROR))
                return -EIO;
@@ -1471,15 +1443,13 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd
        int             rc;
        void __user *argp = (void __user *)arg;
 
-#ifdef DEBUG
-       printk("stl_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n",
-               (int) tty, (int) file, cmd, (int) arg);
-#endif
+       pr_debug("stl_ioctl(tty=%p,file=%p,cmd=%x,arg=%lx)\n", tty, file, cmd,
+                       arg);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return -ENODEV;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return -ENODEV;
 
        if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1536,14 +1506,12 @@ static void stl_settermios(struct tty_struct *tty, struct termios *old)
        stlport_t       *portp;
        struct termios  *tiosp;
 
-#ifdef DEBUG
-       printk("stl_settermios(tty=%x,old=%x)\n", (int) tty, (int) old);
-#endif
+       pr_debug("stl_settermios(tty=%p,old=%p)\n", tty, old);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        tiosp = tty->termios;
@@ -1573,14 +1541,12 @@ static void stl_throttle(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_throttle(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_throttle(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        stl_flowctrl(portp, 0);
 }
@@ -1595,14 +1561,12 @@ static void stl_unthrottle(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_unthrottle(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_unthrottle(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        stl_flowctrl(portp, 1);
 }
@@ -1618,14 +1582,12 @@ static void stl_stop(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_stop(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_stop(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        stl_startrxtx(portp, -1, 0);
 }
@@ -1640,14 +1602,12 @@ static void stl_start(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_start(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_start(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        stl_startrxtx(portp, -1, 1);
 }
@@ -1664,14 +1624,12 @@ static void stl_hangup(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_hangup(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_hangup(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        portp->flags &= ~ASYNC_INITIALIZED;
@@ -1682,13 +1640,13 @@ static void stl_hangup(struct tty_struct *tty)
        stl_flushbuffer(tty);
        portp->istate = 0;
        set_bit(TTY_IO_ERROR, &tty->flags);
-       if (portp->tx.buf != (char *) NULL) {
+       if (portp->tx.buf != NULL) {
                kfree(portp->tx.buf);
-               portp->tx.buf = (char *) NULL;
-               portp->tx.head = (char *) NULL;
-               portp->tx.tail = (char *) NULL;
+               portp->tx.buf = NULL;
+               portp->tx.head = NULL;
+               portp->tx.tail = NULL;
        }
-       portp->tty = (struct tty_struct *) NULL;
+       portp->tty = NULL;
        portp->flags &= ~ASYNC_NORMAL_ACTIVE;
        portp->refcount = 0;
        wake_up_interruptible(&portp->open_wait);
@@ -1700,14 +1658,12 @@ static void stl_flushbuffer(struct tty_struct *tty)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_flushbuffer(tty=%x)\n", (int) tty);
-#endif
+       pr_debug("stl_flushbuffer(tty=%p)\n", tty);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        stl_flush(portp);
@@ -1720,14 +1676,12 @@ static void stl_breakctl(struct tty_struct *tty, int state)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_breakctl(tty=%x,state=%d)\n", (int) tty, state);
-#endif
+       pr_debug("stl_breakctl(tty=%p,state=%d)\n", tty, state);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        stl_sendbreak(portp, ((state == -1) ? 1 : 2));
@@ -1740,14 +1694,12 @@ static void stl_waituntilsent(struct tty_struct *tty, int timeout)
        stlport_t       *portp;
        unsigned long   tend;
 
-#ifdef DEBUG
-       printk("stl_waituntilsent(tty=%x,timeout=%d)\n", (int) tty, timeout);
-#endif
+       pr_debug("stl_waituntilsent(tty=%p,timeout=%d)\n", tty, timeout);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        if (timeout == 0)
@@ -1769,14 +1721,12 @@ static void stl_sendxchar(struct tty_struct *tty, char ch)
 {
        stlport_t       *portp;
 
-#ifdef DEBUG
-       printk("stl_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch);
-#endif
+       pr_debug("stl_sendxchar(tty=%p,ch=%x)\n", tty, ch);
 
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
        portp = tty->driver_data;
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        if (ch == STOP_CHAR(tty))
@@ -1850,11 +1800,8 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
        int             curoff, maxoff;
        char            *pos;
 
-#ifdef DEBUG
-       printk("stl_readproc(page=%x,start=%x,off=%x,count=%d,eof=%x,"
-               "data=%x\n", (int) page, (int) start, (int) off, count,
-               (int) eof, (int) data);
-#endif
+       pr_debug("stl_readproc(page=%p,start=%p,off=%lx,count=%d,eof=%p,"
+               "data=%p\n", page, start, off, count, eof, data);
 
        pos = page;
        totalport = 0;
@@ -1875,7 +1822,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
  */
        for (brdnr = 0; (brdnr < stl_nrbrds); brdnr++) {
                brdp = stl_brds[brdnr];
-               if (brdp == (stlbrd_t *) NULL)
+               if (brdp == NULL)
                        continue;
                if (brdp->state == 0)
                        continue;
@@ -1889,7 +1836,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
                totalport = brdnr * STL_MAXPORTS;
                for (panelnr = 0; (panelnr < brdp->nrpanels); panelnr++) {
                        panelp = brdp->panels[panelnr];
-                       if (panelp == (stlpanel_t *) NULL)
+                       if (panelp == NULL)
                                continue;
 
                        maxoff = curoff + (panelp->nrports * MAXLINE);
@@ -1902,7 +1849,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
                        for (portnr = 0; (portnr < panelp->nrports); portnr++,
                            totalport++) {
                                portp = panelp->ports[portnr];
-                               if (portp == (stlport_t *) NULL)
+                               if (portp == NULL)
                                        continue;
                                if (off >= (curoff += MAXLINE))
                                        continue;
@@ -1927,14 +1874,11 @@ stl_readdone:
  *     calls off to the approrpriate board interrupt handlers.
  */
 
-static irqreturn_t stl_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t stl_intr(int irq, void *dev_id)
 {
-       stlbrd_t        *brdp = (stlbrd_t *) dev_id;
+       stlbrd_t *brdp = dev_id;
 
-#ifdef DEBUG
-       printk("stl_intr(brdp=%x,irq=%d,regs=%x)\n", (int) brdp, irq,
-           (int) regs);
-#endif
+       pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, irq);
 
        return IRQ_RETVAL((* brdp->isr)(brdp));
 }
@@ -2082,23 +2026,19 @@ static int stl_echpci64intr(stlbrd_t *brdp)
 /*
  *     Service an off-level request for some channel.
  */
-static void stl_offintr(void *private)
+static void stl_offintr(struct work_struct *work)
 {
-       stlport_t               *portp;
+       stlport_t               *portp = container_of(work, stlport_t, tqueue);
        struct tty_struct       *tty;
        unsigned int            oldsigs;
 
-       portp = private;
-
-#ifdef DEBUG
-       printk("stl_offintr(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_offintr(portp=%p)\n", portp);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        tty = portp->tty;
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
 
        lock_kernel();
@@ -2130,9 +2070,7 @@ static int __init stl_initports(stlbrd_t *brdp, stlpanel_t *panelp)
        stlport_t       *portp;
        int             chipmask, i;
 
-#ifdef DEBUG
-       printk("stl_initports(brdp=%x,panelp=%x)\n", (int) brdp, (int) panelp);
-#endif
+       pr_debug("stl_initports(brdp=%p,panelp=%p)\n", brdp, panelp);
 
        chipmask = stl_panelinit(brdp, panelp);
 
@@ -2157,7 +2095,7 @@ static int __init stl_initports(stlbrd_t *brdp, stlpanel_t *panelp)
                portp->baud_base = STL_BAUDBASE;
                portp->close_delay = STL_CLOSEDELAY;
                portp->closing_wait = 30 * HZ;
-               INIT_WORK(&portp->tqueue, stl_offintr, portp);
+               INIT_WORK(&portp->tqueue, stl_offintr);
                init_waitqueue_head(&portp->open_wait);
                init_waitqueue_head(&portp->close_wait);
                portp->stats.brd = portp->brdnr;
@@ -2183,9 +2121,7 @@ static inline int stl_initeio(stlbrd_t *brdp)
        char            *name;
        int             rc;
 
-#ifdef DEBUG
-       printk("stl_initeio(brdp=%x)\n", (int) brdp);
-#endif
+       pr_debug("stl_initeio(brdp=%p)\n", brdp);
 
        brdp->ioctrl = brdp->ioaddr1 + 1;
        brdp->iostatus = brdp->ioaddr1 + 2;
@@ -2291,10 +2227,10 @@ static inline int stl_initeio(stlbrd_t *brdp)
        panelp->iobase = brdp->ioaddr1;
        panelp->hwid = status;
        if ((status & EIO_IDBITMASK) == EIO_MK3) {
-               panelp->uartp = (void *) &stl_sc26198uart;
+               panelp->uartp = &stl_sc26198uart;
                panelp->isr = stl_sc26198intr;
        } else {
-               panelp->uartp = (void *) &stl_cd1400uart;
+               panelp->uartp = &stl_cd1400uart;
                panelp->isr = stl_cd1400eiointr;
        }
 
@@ -2326,9 +2262,7 @@ static inline int stl_initech(stlbrd_t *brdp)
        int             panelnr, banknr, i;
        char            *name;
 
-#ifdef DEBUG
-       printk("stl_initech(brdp=%x)\n", (int) brdp);
-#endif
+       pr_debug("stl_initech(brdp=%p)\n", brdp);
 
        status = 0;
        conflict = 0;
@@ -2468,7 +2402,7 @@ static inline int stl_initech(stlbrd_t *brdp)
                brdp->bnkstataddr[banknr++] = ioaddr + ECH_PNLSTATUS;
 
                if (status & ECH_PNLXPID) {
-                       panelp->uartp = (void *) &stl_sc26198uart;
+                       panelp->uartp = &stl_sc26198uart;
                        panelp->isr = stl_sc26198intr;
                        if (status & ECH_PNL16PORT) {
                                panelp->nrports = 16;
@@ -2480,7 +2414,7 @@ static inline int stl_initech(stlbrd_t *brdp)
                                panelp->nrports = 8;
                        }
                } else {
-                       panelp->uartp = (void *) &stl_cd1400uart;
+                       panelp->uartp = &stl_cd1400uart;
                        panelp->isr = stl_cd1400echintr;
                        if (status & ECH_PNL16PORT) {
                                panelp->nrports = 16;
@@ -2536,9 +2470,7 @@ static int __init stl_brdinit(stlbrd_t *brdp)
 {
        int     i;
 
-#ifdef DEBUG
-       printk("stl_brdinit(brdp=%x)\n", (int) brdp);
-#endif
+       pr_debug("stl_brdinit(brdp=%p)\n", brdp);
 
        switch (brdp->brdtype) {
        case BRD_EASYIO:
@@ -2566,7 +2498,7 @@ static int __init stl_brdinit(stlbrd_t *brdp)
        }
 
        for (i = 0; (i < STL_MAXPANELS); i++)
-               if (brdp->panels[i] != (stlpanel_t *) NULL)
+               if (brdp->panels[i] != NULL)
                        stl_initports(brdp, brdp->panels[i]);
 
        printk("STALLION: %s found, board=%d io=%x irq=%d "
@@ -2587,7 +2519,7 @@ static inline int stl_getbrdnr(void)
        int     i;
 
        for (i = 0; (i < STL_MAXBRDS); i++) {
-               if (stl_brds[i] == (stlbrd_t *) NULL) {
+               if (stl_brds[i] == NULL) {
                        if (i >= stl_nrbrds)
                                stl_nrbrds = i + 1;
                        return(i);
@@ -2610,14 +2542,12 @@ static inline int stl_initpcibrd(int brdtype, struct pci_dev *devp)
 {
        stlbrd_t        *brdp;
 
-#ifdef DEBUG
-       printk("stl_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n", brdtype,
+       pr_debug("stl_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n", brdtype,
                devp->bus->number, devp->devfn);
-#endif
 
        if (pci_enable_device(devp))
                return(-EIO);
-       if ((brdp = stl_allocbrd()) == (stlbrd_t *) NULL)
+       if ((brdp = stl_allocbrd()) == NULL)
                return(-ENOMEM);
        if ((brdp->brdnr = stl_getbrdnr()) < 0) {
                printk("STALLION: too many boards found, "
@@ -2630,11 +2560,9 @@ static inline int stl_initpcibrd(int brdtype, struct pci_dev *devp)
  *     Different Stallion boards use the BAR registers in different ways,
  *     so set up io addresses based on board type.
  */
-#ifdef DEBUG
-       printk("%s(%d): BAR[]=%x,%x,%x,%x IRQ=%x\n", __FILE__, __LINE__,
+       pr_debug("%s(%d): BAR[]=%Lx,%Lx,%Lx,%Lx IRQ=%x\n", __FILE__, __LINE__,
                pci_resource_start(devp, 0), pci_resource_start(devp, 1),
                pci_resource_start(devp, 2), pci_resource_start(devp, 3), devp->irq);
-#endif
 
 /*
  *     We have all resources from the board, so let's setup the actual
@@ -2677,9 +2605,7 @@ static inline int stl_findpcibrds(void)
        struct pci_dev  *dev = NULL;
        int             i, rc;
 
-#ifdef DEBUG
-       printk("stl_findpcibrds()\n");
-#endif
+       pr_debug("stl_findpcibrds()\n");
 
        for (i = 0; (i < stl_nrpcibrds); i++)
                while ((dev = pci_find_device(stl_pcibrds[i].vendid,
@@ -2716,9 +2642,7 @@ static inline int stl_initbrds(void)
        stlconf_t       *confp;
        int             i;
 
-#ifdef DEBUG
-       printk("stl_initbrds()\n");
-#endif
+       pr_debug("stl_initbrds()\n");
 
        if (stl_nrbrds > STL_MAXBRDS) {
                printk("STALLION: too many boards in configuration table, "
@@ -2733,7 +2657,7 @@ static inline int stl_initbrds(void)
        for (i = 0; (i < stl_nrbrds); i++) {
                confp = &stl_brdconf[i];
                stl_parsebrd(confp, stl_brdsp[i]);
-               if ((brdp = stl_allocbrd()) == (stlbrd_t *) NULL)
+               if ((brdp = stl_allocbrd()) == NULL)
                        return(-ENOMEM);
                brdp->brdnr = i;
                brdp->brdtype = confp->brdtype;
@@ -2773,7 +2697,7 @@ static int stl_getbrdstats(combrd_t __user *bp)
        if (stl_brdstats.brd >= STL_MAXBRDS)
                return(-ENODEV);
        brdp = stl_brds[stl_brdstats.brd];
-       if (brdp == (stlbrd_t *) NULL)
+       if (brdp == NULL)
                return(-ENODEV);
 
        memset(&stl_brdstats, 0, sizeof(combrd_t));
@@ -2808,17 +2732,17 @@ static stlport_t *stl_getport(int brdnr, int panelnr, int portnr)
        stlpanel_t      *panelp;
 
        if ((brdnr < 0) || (brdnr >= STL_MAXBRDS))
-               return((stlport_t *) NULL);
+               return(NULL);
        brdp = stl_brds[brdnr];
-       if (brdp == (stlbrd_t *) NULL)
-               return((stlport_t *) NULL);
+       if (brdp == NULL)
+               return(NULL);
        if ((panelnr < 0) || (panelnr >= brdp->nrpanels))
-               return((stlport_t *) NULL);
+               return(NULL);
        panelp = brdp->panels[panelnr];
-       if (panelp == (stlpanel_t *) NULL)
-               return((stlport_t *) NULL);
+       if (panelp == NULL)
+               return(NULL);
        if ((portnr < 0) || (portnr >= panelp->nrports))
-               return((stlport_t *) NULL);
+               return(NULL);
        return(panelp->ports[portnr]);
 }
 
@@ -2840,7 +2764,7 @@ static int stl_getportstats(stlport_t *portp, comstats_t __user *cp)
                        return -EFAULT;
                portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
                        stl_comstats.port);
-               if (portp == (stlport_t *) NULL)
+               if (portp == NULL)
                        return(-ENODEV);
        }
 
@@ -2856,12 +2780,12 @@ static int stl_getportstats(stlport_t *portp, comstats_t __user *cp)
        portp->stats.rxbuffered = 0;
 
        spin_lock_irqsave(&stallion_lock, flags);
-       if (portp->tty != (struct tty_struct *) NULL) {
+       if (portp->tty != NULL) {
                if (portp->tty->driver_data == portp) {
                        portp->stats.ttystate = portp->tty->flags;
                        /* No longer available as a statistic */
                        portp->stats.rxbuffered = 1; /*portp->tty->flip.count; */
-                       if (portp->tty->termios != (struct termios *) NULL) {
+                       if (portp->tty->termios != NULL) {
                                portp->stats.cflags = portp->tty->termios->c_cflag;
                                portp->stats.iflags = portp->tty->termios->c_iflag;
                                portp->stats.oflags = portp->tty->termios->c_oflag;
@@ -2895,7 +2819,7 @@ static int stl_clrportstats(stlport_t *portp, comstats_t __user *cp)
                        return -EFAULT;
                portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
                        stl_comstats.port);
-               if (portp == (stlport_t *) NULL)
+               if (portp == NULL)
                        return(-ENODEV);
        }
 
@@ -2959,10 +2883,7 @@ static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, uns
        int     brdnr, rc;
        void __user *argp = (void __user *)arg;
 
-#ifdef DEBUG
-       printk("stl_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n", (int) ip,
-               (int) fp, cmd, (int) arg);
-#endif
+       pr_debug("stl_memioctl(ip=%p,fp=%p,cmd=%x,arg=%lx)\n", ip, fp, cmd,arg);
 
        brdnr = iminor(ip);
        if (brdnr >= STL_MAXBRDS)
@@ -2993,7 +2914,7 @@ static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, uns
        return(rc);
 }
 
-static struct tty_operations stl_ops = {
+static const struct tty_operations stl_ops = {
        .open = stl_open,
        .close = stl_close,
        .write = stl_write,
@@ -3113,9 +3034,7 @@ static int stl_cd1400panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
        int             nrchips, uartaddr, ioaddr;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_panelinit(brdp=%x,panelp=%x)\n", (int) brdp, (int) panelp);
-#endif
+       pr_debug("stl_panelinit(brdp=%p,panelp=%p)\n", brdp, panelp);
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(panelp->brdnr, panelp->pagenr);
@@ -3168,13 +3087,11 @@ static int stl_cd1400panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
 static void stl_cd1400portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *portp)
 {
        unsigned long flags;
-#ifdef DEBUG
-       printk("stl_cd1400portinit(brdp=%x,panelp=%x,portp=%x)\n",
-               (int) brdp, (int) panelp, (int) portp);
-#endif
+       pr_debug("stl_cd1400portinit(brdp=%p,panelp=%p,portp=%p)\n", brdp,
+                       panelp, portp);
 
-       if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) ||
-           (portp == (stlport_t *) NULL))
+       if ((brdp == NULL) || (panelp == NULL) ||
+           (portp == NULL))
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -3245,7 +3162,7 @@ static void stl_cd1400setport(stlport_t *portp, struct termios *tiosp)
        sreroff = 0;
 
        brdp = stl_brds[portp->brdnr];
-       if (brdp == (stlbrd_t *) NULL)
+       if (brdp == NULL)
                return;
 
 /*
@@ -3385,18 +3302,16 @@ static void stl_cd1400setport(stlport_t *portp, struct termios *tiosp)
  *     them all up.
  */
 
-#ifdef DEBUG
-       printk("SETPORT: portnr=%d panelnr=%d brdnr=%d\n",
+       pr_debug("SETPORT: portnr=%d panelnr=%d brdnr=%d\n",
                portp->portnr, portp->panelnr, portp->brdnr);
-       printk("    cor1=%x cor2=%x cor3=%x cor4=%x cor5=%x\n",
+       pr_debug("    cor1=%x cor2=%x cor3=%x cor4=%x cor5=%x\n",
                cor1, cor2, cor3, cor4, cor5);
-       printk("    mcor1=%x mcor2=%x rtpr=%x sreron=%x sreroff=%x\n",
+       pr_debug("    mcor1=%x mcor2=%x rtpr=%x sreron=%x sreroff=%x\n",
                mcor1, mcor2, rtpr, sreron, sreroff);
-       printk("    tcor=%x tbpr=%x rcor=%x rbpr=%x\n", clk, div, clk, div);
-       printk("    schr1=%x schr2=%x schr3=%x schr4=%x\n",
+       pr_debug("    tcor=%x tbpr=%x rcor=%x rbpr=%x\n", clk, div, clk, div);
+       pr_debug("    schr1=%x schr2=%x schr3=%x schr4=%x\n",
                tiosp->c_cc[VSTART], tiosp->c_cc[VSTOP],
                tiosp->c_cc[VSTART], tiosp->c_cc[VSTOP]);
-#endif
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -3449,10 +3364,8 @@ static void stl_cd1400setsignals(stlport_t *portp, int dtr, int rts)
        unsigned char   msvr1, msvr2;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400setsignals(portp=%x,dtr=%d,rts=%d)\n",
-               (int) portp, dtr, rts);
-#endif
+       pr_debug("stl_cd1400setsignals(portp=%p,dtr=%d,rts=%d)\n",
+                       portp, dtr, rts);
 
        msvr1 = 0;
        msvr2 = 0;
@@ -3484,9 +3397,7 @@ static int stl_cd1400getsignals(stlport_t *portp)
        unsigned long   flags;
        int             sigs;
 
-#ifdef DEBUG
-       printk("stl_cd1400getsignals(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_cd1400getsignals(portp=%p)\n", portp);
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -3521,10 +3432,8 @@ static void stl_cd1400enablerxtx(stlport_t *portp, int rx, int tx)
        unsigned char   ccr;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400enablerxtx(portp=%x,rx=%d,tx=%d)\n",
-               (int) portp, rx, tx);
-#endif
+       pr_debug("stl_cd1400enablerxtx(portp=%p,rx=%d,tx=%d)\n", portp, rx, tx);
+
        ccr = 0;
 
        if (tx == 0)
@@ -3557,10 +3466,7 @@ static void stl_cd1400startrxtx(stlport_t *portp, int rx, int tx)
        unsigned char   sreron, sreroff;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400startrxtx(portp=%x,rx=%d,tx=%d)\n",
-               (int) portp, rx, tx);
-#endif
+       pr_debug("stl_cd1400startrxtx(portp=%p,rx=%d,tx=%d)\n", portp, rx, tx);
 
        sreron = 0;
        sreroff = 0;
@@ -3596,9 +3502,8 @@ static void stl_cd1400disableintrs(stlport_t *portp)
 {
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400disableintrs(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_cd1400disableintrs(portp=%p)\n", portp);
+
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
        stl_cd1400setreg(portp, CAR, (portp->portnr & 0x03));
@@ -3613,9 +3518,7 @@ static void stl_cd1400sendbreak(stlport_t *portp, int len)
 {
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400sendbreak(portp=%x,len=%d)\n", (int) portp, len);
-#endif
+       pr_debug("stl_cd1400sendbreak(portp=%p,len=%d)\n", portp, len);
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -3641,14 +3544,12 @@ static void stl_cd1400flowctrl(stlport_t *portp, int state)
        struct tty_struct       *tty;
        unsigned long           flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400flowctrl(portp=%x,state=%x)\n", (int) portp, state);
-#endif
+       pr_debug("stl_cd1400flowctrl(portp=%p,state=%x)\n", portp, state);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        tty = portp->tty;
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -3705,14 +3606,12 @@ static void stl_cd1400sendflow(stlport_t *portp, int state)
        struct tty_struct       *tty;
        unsigned long           flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400sendflow(portp=%x,state=%x)\n", (int) portp, state);
-#endif
+       pr_debug("stl_cd1400sendflow(portp=%p,state=%x)\n", portp, state);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        tty = portp->tty;
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -3739,11 +3638,9 @@ static void stl_cd1400flush(stlport_t *portp)
 {
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_cd1400flush(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_cd1400flush(portp=%p)\n", portp);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -3768,11 +3665,9 @@ static void stl_cd1400flush(stlport_t *portp)
 
 static int stl_cd1400datastate(stlport_t *portp)
 {
-#ifdef DEBUG
-       printk("stl_cd1400datastate(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_cd1400datastate(portp=%p)\n", portp);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return 0;
 
        return test_bit(ASYI_TXBUSY, &portp->istate) ? 1 : 0;
@@ -3788,10 +3683,7 @@ static void stl_cd1400eiointr(stlpanel_t *panelp, unsigned int iobase)
 {
        unsigned char   svrtype;
 
-#ifdef DEBUG
-       printk("stl_cd1400eiointr(panelp=%x,iobase=%x)\n",
-               (int) panelp, iobase);
-#endif
+       pr_debug("stl_cd1400eiointr(panelp=%p,iobase=%x)\n", panelp, iobase);
 
        spin_lock(&brd_lock);
        outb(SVRR, iobase);
@@ -3821,10 +3713,7 @@ static void stl_cd1400echintr(stlpanel_t *panelp, unsigned int iobase)
 {
        unsigned char   svrtype;
 
-#ifdef DEBUG
-       printk("stl_cd1400echintr(panelp=%x,iobase=%x)\n", (int) panelp,
-               iobase);
-#endif
+       pr_debug("stl_cd1400echintr(panelp=%p,iobase=%x)\n", panelp, iobase);
 
        outb(SVRR, iobase);
        svrtype = inb(iobase + EREG_DATA);
@@ -3895,9 +3784,7 @@ static void stl_cd1400txisr(stlpanel_t *panelp, int ioaddr)
        char            *head, *tail;
        unsigned char   ioack, srer;
 
-#ifdef DEBUG
-       printk("stl_cd1400txisr(panelp=%x,ioaddr=%x)\n", (int) panelp, ioaddr);
-#endif
+       pr_debug("stl_cd1400txisr(panelp=%p,ioaddr=%x)\n", panelp, ioaddr);
 
        ioack = inb(ioaddr + EREG_TXACK);
        if (((ioack & panelp->ackmask) != 0) ||
@@ -3977,9 +3864,7 @@ static void stl_cd1400rxisr(stlpanel_t *panelp, int ioaddr)
        unsigned char           status;
        char                    ch;
 
-#ifdef DEBUG
-       printk("stl_cd1400rxisr(panelp=%x,ioaddr=%x)\n", (int) panelp, ioaddr);
-#endif
+       pr_debug("stl_cd1400rxisr(panelp=%p,ioaddr=%x)\n", panelp, ioaddr);
 
        ioack = inb(ioaddr + EREG_RXACK);
        if ((ioack & panelp->ackmask) != 0) {
@@ -4075,9 +3960,7 @@ static void stl_cd1400mdmisr(stlpanel_t *panelp, int ioaddr)
        unsigned int    ioack;
        unsigned char   misr;
 
-#ifdef DEBUG
-       printk("stl_cd1400mdmisr(panelp=%x)\n", (int) panelp);
-#endif
+       pr_debug("stl_cd1400mdmisr(panelp=%p)\n", panelp);
 
        ioack = inb(ioaddr + EREG_MDACK);
        if (((ioack & panelp->ackmask) != 0) ||
@@ -4164,10 +4047,7 @@ static int stl_sc26198panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
        int     chipmask, i;
        int     nrchips, ioaddr;
 
-#ifdef DEBUG
-       printk("stl_sc26198panelinit(brdp=%x,panelp=%x)\n",
-               (int) brdp, (int) panelp);
-#endif
+       pr_debug("stl_sc26198panelinit(brdp=%p,panelp=%p)\n", brdp, panelp);
 
        BRDENABLE(panelp->brdnr, panelp->pagenr);
 
@@ -4209,13 +4089,11 @@ static int stl_sc26198panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
 
 static void stl_sc26198portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *portp)
 {
-#ifdef DEBUG
-       printk("stl_sc26198portinit(brdp=%x,panelp=%x,portp=%x)\n",
-               (int) brdp, (int) panelp, (int) portp);
-#endif
+       pr_debug("stl_sc26198portinit(brdp=%p,panelp=%p,portp=%p)\n", brdp,
+                       panelp, portp);
 
-       if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) ||
-           (portp == (stlport_t *) NULL))
+       if ((brdp == NULL) || (panelp == NULL) ||
+           (portp == NULL))
                return;
 
        portp->ioaddr = panelp->iobase + ((portp->portnr < 8) ? 0 : 4);
@@ -4252,7 +4130,7 @@ static void stl_sc26198setport(stlport_t *portp, struct termios *tiosp)
        imroff = 0;
 
        brdp = stl_brds[portp->brdnr];
-       if (brdp == (stlbrd_t *) NULL)
+       if (brdp == NULL)
                return;
 
 /*
@@ -4386,15 +4264,13 @@ static void stl_sc26198setport(stlport_t *portp, struct termios *tiosp)
  *     them all up.
  */
 
-#ifdef DEBUG
-       printk("SETPORT: portnr=%d panelnr=%d brdnr=%d\n",
+       pr_debug("SETPORT: portnr=%d panelnr=%d brdnr=%d\n",
                portp->portnr, portp->panelnr, portp->brdnr);
-       printk("    mr0=%x mr1=%x mr2=%x clk=%x\n", mr0, mr1, mr2, clk);
-       printk("    iopr=%x imron=%x imroff=%x\n", iopr, imron, imroff);
-       printk("    schr1=%x schr2=%x schr3=%x schr4=%x\n",
+       pr_debug("    mr0=%x mr1=%x mr2=%x clk=%x\n", mr0, mr1, mr2, clk);
+       pr_debug("    iopr=%x imron=%x imroff=%x\n", iopr, imron, imroff);
+       pr_debug("    schr1=%x schr2=%x schr3=%x schr4=%x\n",
                tiosp->c_cc[VSTART], tiosp->c_cc[VSTOP],
                tiosp->c_cc[VSTART], tiosp->c_cc[VSTOP]);
-#endif
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -4437,10 +4313,8 @@ static void stl_sc26198setsignals(stlport_t *portp, int dtr, int rts)
        unsigned char   iopioron, iopioroff;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_sc26198setsignals(portp=%x,dtr=%d,rts=%d)\n",
-               (int) portp, dtr, rts);
-#endif
+       pr_debug("stl_sc26198setsignals(portp=%p,dtr=%d,rts=%d)\n", portp,
+                       dtr, rts);
 
        iopioron = 0;
        iopioroff = 0;
@@ -4473,9 +4347,7 @@ static int stl_sc26198getsignals(stlport_t *portp)
        unsigned long   flags;
        int             sigs;
 
-#ifdef DEBUG
-       printk("stl_sc26198getsignals(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_sc26198getsignals(portp=%p)\n", portp);
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -4503,10 +4375,7 @@ static void stl_sc26198enablerxtx(stlport_t *portp, int rx, int tx)
        unsigned char   ccr;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_sc26198enablerxtx(portp=%x,rx=%d,tx=%d)\n",
-               (int) portp, rx, tx);
-#endif
+       pr_debug("stl_sc26198enablerxtx(portp=%p,rx=%d,tx=%d)\n", portp, rx,tx);
 
        ccr = portp->crenable;
        if (tx == 0)
@@ -4537,10 +4406,7 @@ static void stl_sc26198startrxtx(stlport_t *portp, int rx, int tx)
        unsigned char   imr;
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_sc26198startrxtx(portp=%x,rx=%d,tx=%d)\n",
-               (int) portp, rx, tx);
-#endif
+       pr_debug("stl_sc26198startrxtx(portp=%p,rx=%d,tx=%d)\n", portp, rx, tx);
 
        imr = portp->imr;
        if (tx == 0)
@@ -4572,9 +4438,7 @@ static void stl_sc26198disableintrs(stlport_t *portp)
 {
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_sc26198disableintrs(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_sc26198disableintrs(portp=%p)\n", portp);
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -4590,9 +4454,7 @@ static void stl_sc26198sendbreak(stlport_t *portp, int len)
 {
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_sc26198sendbreak(portp=%x,len=%d)\n", (int) portp, len);
-#endif
+       pr_debug("stl_sc26198sendbreak(portp=%p,len=%d)\n", portp, len);
 
        spin_lock_irqsave(&brd_lock, flags);
        BRDENABLE(portp->brdnr, portp->pagenr);
@@ -4618,14 +4480,12 @@ static void stl_sc26198flowctrl(stlport_t *portp, int state)
        unsigned long           flags;
        unsigned char           mr0;
 
-#ifdef DEBUG
-       printk("stl_sc26198flowctrl(portp=%x,state=%x)\n", (int) portp, state);
-#endif
+       pr_debug("stl_sc26198flowctrl(portp=%p,state=%x)\n", portp, state);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        tty = portp->tty;
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -4689,14 +4549,12 @@ static void stl_sc26198sendflow(stlport_t *portp, int state)
        unsigned long           flags;
        unsigned char           mr0;
 
-#ifdef DEBUG
-       printk("stl_sc26198sendflow(portp=%x,state=%x)\n", (int) portp, state);
-#endif
+       pr_debug("stl_sc26198sendflow(portp=%p,state=%x)\n", portp, state);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
        tty = portp->tty;
-       if (tty == (struct tty_struct *) NULL)
+       if (tty == NULL)
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -4728,11 +4586,9 @@ static void stl_sc26198flush(stlport_t *portp)
 {
        unsigned long   flags;
 
-#ifdef DEBUG
-       printk("stl_sc26198flush(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_sc26198flush(portp=%p)\n", portp);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        spin_lock_irqsave(&brd_lock, flags);
@@ -4759,11 +4615,9 @@ static int stl_sc26198datastate(stlport_t *portp)
        unsigned long   flags;
        unsigned char   sr;
 
-#ifdef DEBUG
-       printk("stl_sc26198datastate(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_sc26198datastate(portp=%p)\n", portp);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return 0;
        if (test_bit(ASYI_TXBUSY, &portp->istate))
                return 1;
@@ -4788,11 +4642,9 @@ static void stl_sc26198wait(stlport_t *portp)
 {
        int     i;
 
-#ifdef DEBUG
-       printk("stl_sc26198wait(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_sc26198wait(portp=%p)\n", portp);
 
-       if (portp == (stlport_t *) NULL)
+       if (portp == NULL)
                return;
 
        for (i = 0; (i < 20); i++)
@@ -4870,9 +4722,7 @@ static void stl_sc26198txisr(stlport_t *portp)
        int             len, stlen;
        char            *head, *tail;
 
-#ifdef DEBUG
-       printk("stl_sc26198txisr(portp=%x)\n", (int) portp);
-#endif
+       pr_debug("stl_sc26198txisr(portp=%p)\n", portp);
 
        ioaddr = portp->ioaddr;
        head = portp->tx.head;
@@ -4931,9 +4781,7 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack)
        struct tty_struct       *tty;
        unsigned int            len, buflen, ioaddr;
 
-#ifdef DEBUG
-       printk("stl_sc26198rxisr(portp=%x,iack=%x)\n", (int) portp, iack);
-#endif
+       pr_debug("stl_sc26198rxisr(portp=%p,iack=%x)\n", portp, iack);
 
        tty = portp->tty;
        ioaddr = portp->ioaddr;
@@ -4968,8 +4816,8 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack)
  *     flow control modes of the sc26198.
  */
        if (test_bit(ASYI_TXFLOWED, &portp->istate)) {
-               if ((tty != (struct tty_struct *) NULL) &&
-                   (tty->termios != (struct termios *) NULL) &&
+               if ((tty != NULL) &&
+                   (tty->termios != NULL) &&
                    (tty->termios->c_iflag & IXANY)) {
                        stl_sc26198txunflow(portp, tty);
                }
@@ -4999,7 +4847,7 @@ static inline void stl_sc26198rxbadch(stlport_t *portp, unsigned char status, ch
        if (status & SR_RXBREAK)
                portp->stats.rxbreaks++;
 
-       if ((tty != (struct tty_struct *) NULL) &&
+       if ((tty != NULL) &&
            ((portp->rxignoremsk & status) == 0)) {
                if (portp->rxmarkmsk & status) {
                        if (status & SR_RXBREAK) {
@@ -5077,9 +4925,7 @@ static void stl_sc26198otherisr(stlport_t *portp, unsigned int iack)
 {
        unsigned char   cir, ipr, xisr;
 
-#ifdef DEBUG
-       printk("stl_sc26198otherisr(portp=%x,iack=%x)\n", (int) portp, iack);
-#endif
+       pr_debug("stl_sc26198otherisr(portp=%p,iack=%x)\n", portp, iack);
 
        cir = stl_sc26198getglobreg(portp, CIR);