epca: lock_kernel push down
Prepare epca for removing the lock from above. Most of epca is internally locked so we can trivially push it down to a few bits of code. Drop the TIOCG/SSOFTCAR handling as that is done *properly* with locks by the mid layer. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
7b130c0efd
commit
37925e0503
1 changed files with 2 additions and 15 deletions
|
@ -2206,21 +2206,6 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
|
||||||
tty_wait_until_sent(tty, 0);
|
tty_wait_until_sent(tty, 0);
|
||||||
digi_send_break(ch, arg ? arg*(HZ/10) : HZ/4);
|
digi_send_break(ch, arg ? arg*(HZ/10) : HZ/4);
|
||||||
return 0;
|
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:
|
case TIOCMODG:
|
||||||
mflag = pc_tiocmget(tty, file);
|
mflag = pc_tiocmget(tty, file);
|
||||||
if (put_user(mflag, (unsigned long __user *)argp))
|
if (put_user(mflag, (unsigned long __user *)argp))
|
||||||
|
@ -2253,6 +2238,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
|
||||||
break;
|
break;
|
||||||
case DIGI_SETAW:
|
case DIGI_SETAW:
|
||||||
case DIGI_SETAF:
|
case DIGI_SETAF:
|
||||||
|
lock_kernel();
|
||||||
if (cmd == DIGI_SETAW) {
|
if (cmd == DIGI_SETAW) {
|
||||||
/* Setup an event to indicate when the transmit buffer empties */
|
/* Setup an event to indicate when the transmit buffer empties */
|
||||||
spin_lock_irqsave(&epca_lock, flags);
|
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)
|
if (tty->ldisc.flush_buffer)
|
||||||
tty->ldisc.flush_buffer(tty);
|
tty->ldisc.flush_buffer(tty);
|
||||||
}
|
}
|
||||||
|
unlock_kernel();
|
||||||
/* Fall Thru */
|
/* Fall Thru */
|
||||||
case DIGI_SETA:
|
case DIGI_SETA:
|
||||||
if (copy_from_user(&ch->digiext, argp, sizeof(digi_t)))
|
if (copy_from_user(&ch->digiext, argp, sizeof(digi_t)))
|
||||||
|
|
Reference in a new issue