Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

complete ->[sg]et_serial() switchover

Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 930236a3 15cc7bad

+6 -12
+4 -10
drivers/tty/tty_io.c
··· 2474 2474 pr_warn("%s: '%s' is using deprecated serial flags (with no effect): %.8x\n", 2475 2475 __func__, get_task_comm(comm, current), flags); 2476 2476 if (!tty->ops->set_serial) 2477 - return -ENOIOCTLCMD; 2477 + return -ENOTTY; 2478 2478 return tty->ops->set_serial(tty, &v); 2479 2479 } 2480 2480 ··· 2485 2485 2486 2486 memset(&v, 0, sizeof(struct serial_struct)); 2487 2487 if (!tty->ops->get_serial) 2488 - return -ENOIOCTLCMD; 2488 + return -ENOTTY; 2489 2489 err = tty->ops->get_serial(tty, &v); 2490 2490 if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct))) 2491 2491 err = -EFAULT; ··· 2621 2621 } 2622 2622 break; 2623 2623 case TIOCSSERIAL: 2624 - retval = tty_tiocsserial(tty, p); 2625 - if (retval != -ENOIOCTLCMD) 2626 - return retval; 2627 - break; 2624 + return tty_tiocsserial(tty, p); 2628 2625 case TIOCGSERIAL: 2629 - retval = tty_tiocgserial(tty, p); 2630 - if (retval != -ENOIOCTLCMD) 2631 - return retval; 2632 - break; 2626 + return tty_tiocgserial(tty, p); 2633 2627 case TIOCGPTPEER: 2634 2628 /* Special because the struct file is needed */ 2635 2629 return ptm_open_peer(file, tty, (int)arg);
+2 -2
drivers/usb/serial/usb-serial.c
··· 402 402 403 403 if (port->serial->type->get_serial) 404 404 return port->serial->type->get_serial(tty, ss); 405 - return -ENOIOCTLCMD; 405 + return -ENOTTY; 406 406 } 407 407 408 408 static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss) ··· 411 411 412 412 if (port->serial->type->set_serial) 413 413 return port->serial->type->set_serial(tty, ss); 414 - return -ENOIOCTLCMD; 414 + return -ENOTTY; 415 415 } 416 416 417 417 static int serial_ioctl(struct tty_struct *tty,