epca: lock_kernel push down
[pandora-kernel.git] / drivers / char / epca.c
index ffcecde..9a68285 100644 (file)
@@ -1797,7 +1797,7 @@ static unsigned termios2digi_c(struct channel *ch, unsigned cflag)
        res |= cflag & ((CBAUD ^ CBAUDEX) | PARODD | PARENB | CSTOPB | CSIZE);
        /*
         * This gets a little confusing. The Digi cards have their own
-        * representation of c_cflags controling baud rate. For the most part
+        * representation of c_cflags controlling baud rate. For the most part
         * this is identical to the Linux implementation. However; Digi
         * supports one rate (76800) that Linux doesn't. This means that the
         * c_cflag entry that would normally mean 76800 for Digi actually means
@@ -2068,7 +2068,7 @@ static int info_ioctl(struct tty_struct *tty, struct file *file,
                {
                        /*
                         * This call is made by the apps to complete the
-                        * initilization of the board(s). This routine is
+                        * initialization of the board(s). This routine is
                         * responsible for setting the card to its initial
                         * state and setting the drivers control fields to the
                         * sutianle settings for the card in question.
@@ -2206,21 +2206,6 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
                tty_wait_until_sent(tty, 0);
                digi_send_break(ch, arg ? arg*(HZ/10) : HZ/4);
                return 0;
-       case TIOCGSOFTCAR:
-               if (put_user(C_CLOCAL(tty)?1:0, (unsigned long __user *)arg))
-                       return -EFAULT;
-               return 0;
-       case TIOCSSOFTCAR:
-               {
-                       unsigned int value;
-
-                       if (get_user(value, (unsigned __user *)argp))
-                               return -EFAULT;
-                       tty->termios->c_cflag =
-                               ((tty->termios->c_cflag & ~CLOCAL) |
-                                (value ? CLOCAL : 0));
-                       return 0;
-               }
        case TIOCMODG:
                mflag = pc_tiocmget(tty, file);
                if (put_user(mflag, (unsigned long __user *)argp))
@@ -2253,6 +2238,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
                break;
        case DIGI_SETAW:
        case DIGI_SETAF:
+               lock_kernel();
                if (cmd == DIGI_SETAW) {
                        /* Setup an event to indicate when the transmit buffer empties */
                        spin_lock_irqsave(&epca_lock, flags);
@@ -2264,6 +2250,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
                        if (tty->ldisc.flush_buffer)
                                tty->ldisc.flush_buffer(tty);
                }
+               unlock_kernel();
                /* Fall Thru */
        case DIGI_SETA:
                if (copy_from_user(&ch->digiext, argp, sizeof(digi_t)))