Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
[sfrench/cifs-2.6.git] / drivers / char / istallion.c
index 7b279d1de4a2eac8d6781269eb4b52f738d5cc5a..c645455c3fd1552ed9f7932bd28dabb7f963280d 100644 (file)
@@ -627,7 +627,6 @@ static int  stli_initopen(struct stlibrd *brdp, struct stliport *portp);
 static int     stli_rawopen(struct stlibrd *brdp, struct stliport *portp, unsigned long arg, int wait);
 static int     stli_rawclose(struct stlibrd *brdp, struct stliport *portp, unsigned long arg, int wait);
 static int     stli_waitcarrier(struct stlibrd *brdp, struct stliport *portp, struct file *filp);
-static void    stli_dohangup(struct work_struct *);
 static int     stli_setport(struct stliport *portp);
 static int     stli_cmdwait(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback);
 static void    stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback);
@@ -1753,9 +1752,6 @@ static void stli_settermios(struct tty_struct *tty, struct ktermios *old)
                return;
 
        tiosp = tty->termios;
-       if ((tiosp->c_cflag == old->c_cflag) &&
-           (tiosp->c_iflag == old->c_iflag))
-               return;
 
        stli_mkasyport(portp, &aport, tiosp);
        stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0);
@@ -1826,25 +1822,6 @@ static void stli_start(struct tty_struct *tty)
 
 /*****************************************************************************/
 
-/*
- *     Scheduler called hang up routine. This is called from the scheduler,
- *     not direct from the driver "poll" routine. We can't call it there
- *     since the real local hangup code will enable/disable the board and
- *     other things that we can't do while handling the poll. Much easier
- *     to deal with it some time later (don't really care when, hangups
- *     aren't that time critical).
- */
-
-static void stli_dohangup(struct work_struct *ugly_api)
-{
-       struct stliport *portp = container_of(ugly_api, struct stliport, tqhangup);
-       if (portp->tty != NULL) {
-               tty_hangup(portp->tty);
-       }
-}
-
-/*****************************************************************************/
-
 /*
  *     Hangup this port. This is pretty much like closing the port, only
  *     a little more brutal. No waiting for data to drain. Shutdown the
@@ -2166,14 +2143,10 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne
        cdkhdr_t __iomem *hdrp;
        cdkctrl_t __iomem *cp;
        unsigned char __iomem *bits;
-       unsigned long flags;
-
-       spin_lock_irqsave(&brd_lock, flags);
 
        if (test_bit(ST_CMDING, &portp->state)) {
                printk(KERN_ERR "STALLION: command already busy, cmd=%x!\n",
                                (int) cmd);
-               spin_unlock_irqrestore(&brd_lock, flags);
                return;
        }
 
@@ -2194,7 +2167,6 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne
        writeb(readb(bits) | portp->portbit, bits);
        set_bit(ST_CMDING, &portp->state);
        EBRDDISABLE(brdp);
-       spin_unlock_irqrestore(&brd_lock, flags);
 }
 
 static void stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback)
@@ -2413,7 +2385,7 @@ static int stli_hostcmd(struct stlibrd *brdp, struct stliport *portp)
                            ((portp->sigs & TIOCM_CD) == 0)) {
                                if (portp->flags & ASYNC_CHECK_CD) {
                                        if (tty)
-                                               schedule_work(&portp->tqhangup);
+                                               tty_hangup(tty);
                                }
                        }
                }
@@ -2741,7 +2713,6 @@ static int stli_initports(struct stlibrd *brdp)
                portp->baud_base = STL_BAUDBASE;
                portp->close_delay = STL_CLOSEDELAY;
                portp->closing_wait = 30 * HZ;
-               INIT_WORK(&portp->tqhangup, stli_dohangup);
                init_waitqueue_head(&portp->open_wait);
                init_waitqueue_head(&portp->close_wait);
                init_waitqueue_head(&portp->raw_wait);
@@ -3218,13 +3189,13 @@ static int stli_initecp(struct stlibrd *brdp)
                goto err;
        }
 
+       brdp->iosize = ECP_IOSIZE;
+
        if (!request_region(brdp->iobase, brdp->iosize, "istallion")) {
                retval = -EIO;
                goto err;
        }
 
-       brdp->iosize = ECP_IOSIZE;
-
 /*
  *     Based on the specific board type setup the common vars to access
  *     and enable shared memory. Set all board specific information now
@@ -4632,9 +4603,8 @@ static int __init istallion_module_init(void)
 
        istallion_class = class_create(THIS_MODULE, "staliomem");
        for (i = 0; i < 4; i++)
-               class_device_create(istallion_class, NULL,
-                               MKDEV(STL_SIOMEMMAJOR, i),
-                               NULL, "staliomem%d", i);
+               device_create(istallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
+                             "staliomem%d", i);
 
        return 0;
 err_deinit:
@@ -4667,8 +4637,7 @@ static void __exit istallion_module_exit(void)
        unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
 
        for (j = 0; j < 4; j++)
-               class_device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR,
-                                       j));
+               device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR, j));
        class_destroy(istallion_class);
 
        pci_unregister_driver(&stli_pcidriver);