diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/riscom8.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 3f9d0a9ac36d..b56e0e04cb4a 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c | |||
@@ -1385,7 +1385,7 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp, | |||
1385 | { | 1385 | { |
1386 | struct riscom_port *port = (struct riscom_port *)tty->driver_data; | 1386 | struct riscom_port *port = (struct riscom_port *)tty->driver_data; |
1387 | void __user *argp = (void __user *)arg; | 1387 | void __user *argp = (void __user *)arg; |
1388 | int retval; | 1388 | int retval = 0; |
1389 | 1389 | ||
1390 | if (rc_paranoia_check(port, tty->name, "rc_ioctl")) | 1390 | if (rc_paranoia_check(port, tty->name, "rc_ioctl")) |
1391 | return -ENODEV; | 1391 | return -ENODEV; |
@@ -1406,23 +1406,20 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp, | |||
1406 | tty_wait_until_sent(tty, 0); | 1406 | tty_wait_until_sent(tty, 0); |
1407 | rc_send_break(port, arg ? arg*(HZ/10) : HZ/4); | 1407 | rc_send_break(port, arg ? arg*(HZ/10) : HZ/4); |
1408 | break; | 1408 | break; |
1409 | case TIOCGSOFTCAR: | 1409 | case TIOCGSERIAL: |
1410 | return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned __user *)argp); | 1410 | lock_kernel(); |
1411 | case TIOCSSOFTCAR: | 1411 | retval = rc_get_serial_info(port, argp); |
1412 | if (get_user(arg,(unsigned __user *) argp)) | 1412 | unlock_kernel(); |
1413 | return -EFAULT; | ||
1414 | tty->termios->c_cflag = | ||
1415 | ((tty->termios->c_cflag & ~CLOCAL) | | ||
1416 | (arg ? CLOCAL : 0)); | ||
1417 | break; | 1413 | break; |
1418 | case TIOCGSERIAL: | ||
1419 | return rc_get_serial_info(port, argp); | ||
1420 | case TIOCSSERIAL: | 1414 | case TIOCSSERIAL: |
1421 | return rc_set_serial_info(port, argp); | 1415 | lock_kernel(); |
1416 | retval = rc_set_serial_info(port, argp); | ||
1417 | unlock_kernel(); | ||
1418 | break; | ||
1422 | default: | 1419 | default: |
1423 | return -ENOIOCTLCMD; | 1420 | retval = -ENOIOCTLCMD; |
1424 | } | 1421 | } |
1425 | return 0; | 1422 | return retval; |
1426 | } | 1423 | } |
1427 | 1424 | ||
1428 | static void rc_throttle(struct tty_struct * tty) | 1425 | static void rc_throttle(struct tty_struct * tty) |