riscom8: Prepare for BKL pushdown
Push the locking down into a couple of functions that need it and remove bogus TIOCG/SSOFTCAR handling Signed-off-by: Alan Cox <alan@redhat.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
9d6d162d49
commit
eb17455296
|
@ -1385,7 +1385,7 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp,
|
||||||
{
|
{
|
||||||
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
|
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
|
||||||
void __user *argp = (void __user *)arg;
|
void __user *argp = (void __user *)arg;
|
||||||
int retval;
|
int retval = 0;
|
||||||
|
|
||||||
if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
|
if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@ -1406,23 +1406,20 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp,
|
||||||
tty_wait_until_sent(tty, 0);
|
tty_wait_until_sent(tty, 0);
|
||||||
rc_send_break(port, arg ? arg*(HZ/10) : HZ/4);
|
rc_send_break(port, arg ? arg*(HZ/10) : HZ/4);
|
||||||
break;
|
break;
|
||||||
case TIOCGSOFTCAR:
|
case TIOCGSERIAL:
|
||||||
return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned __user *)argp);
|
lock_kernel();
|
||||||
case TIOCSSOFTCAR:
|
retval = rc_get_serial_info(port, argp);
|
||||||
if (get_user(arg,(unsigned __user *) argp))
|
unlock_kernel();
|
||||||
return -EFAULT;
|
|
||||||
tty->termios->c_cflag =
|
|
||||||
((tty->termios->c_cflag & ~CLOCAL) |
|
|
||||||
(arg ? CLOCAL : 0));
|
|
||||||
break;
|
break;
|
||||||
case TIOCGSERIAL:
|
|
||||||
return rc_get_serial_info(port, argp);
|
|
||||||
case TIOCSSERIAL:
|
case TIOCSSERIAL:
|
||||||
return rc_set_serial_info(port, argp);
|
lock_kernel();
|
||||||
|
retval = rc_set_serial_info(port, argp);
|
||||||
|
unlock_kernel();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return -ENOIOCTLCMD;
|
retval = -ENOIOCTLCMD;
|
||||||
}
|
}
|
||||||
return 0;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rc_throttle(struct tty_struct * tty)
|
static void rc_throttle(struct tty_struct * tty)
|
||||||
|
|
Loading…
Reference in New Issue