mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 18:23:53 +08:00
complete ->[sg]et_serial() switchover
Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
15cc7bad48
commit
930236a308
@ -2474,7 +2474,7 @@ static int tty_tiocsserial(struct tty_struct *tty, struct serial_struct __user *
|
|||||||
pr_warn("%s: '%s' is using deprecated serial flags (with no effect): %.8x\n",
|
pr_warn("%s: '%s' is using deprecated serial flags (with no effect): %.8x\n",
|
||||||
__func__, get_task_comm(comm, current), flags);
|
__func__, get_task_comm(comm, current), flags);
|
||||||
if (!tty->ops->set_serial)
|
if (!tty->ops->set_serial)
|
||||||
return -ENOIOCTLCMD;
|
return -ENOTTY;
|
||||||
return tty->ops->set_serial(tty, &v);
|
return tty->ops->set_serial(tty, &v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2485,7 +2485,7 @@ static int tty_tiocgserial(struct tty_struct *tty, struct serial_struct __user *
|
|||||||
|
|
||||||
memset(&v, 0, sizeof(struct serial_struct));
|
memset(&v, 0, sizeof(struct serial_struct));
|
||||||
if (!tty->ops->get_serial)
|
if (!tty->ops->get_serial)
|
||||||
return -ENOIOCTLCMD;
|
return -ENOTTY;
|
||||||
err = tty->ops->get_serial(tty, &v);
|
err = tty->ops->get_serial(tty, &v);
|
||||||
if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
|
if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
@ -2621,15 +2621,9 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TIOCSSERIAL:
|
case TIOCSSERIAL:
|
||||||
retval = tty_tiocsserial(tty, p);
|
return tty_tiocsserial(tty, p);
|
||||||
if (retval != -ENOIOCTLCMD)
|
|
||||||
return retval;
|
|
||||||
break;
|
|
||||||
case TIOCGSERIAL:
|
case TIOCGSERIAL:
|
||||||
retval = tty_tiocgserial(tty, p);
|
return tty_tiocgserial(tty, p);
|
||||||
if (retval != -ENOIOCTLCMD)
|
|
||||||
return retval;
|
|
||||||
break;
|
|
||||||
case TIOCGPTPEER:
|
case TIOCGPTPEER:
|
||||||
/* Special because the struct file is needed */
|
/* Special because the struct file is needed */
|
||||||
return ptm_open_peer(file, tty, (int)arg);
|
return ptm_open_peer(file, tty, (int)arg);
|
||||||
|
@ -402,7 +402,7 @@ static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
|
|||||||
|
|
||||||
if (port->serial->type->get_serial)
|
if (port->serial->type->get_serial)
|
||||||
return port->serial->type->get_serial(tty, ss);
|
return port->serial->type->get_serial(tty, ss);
|
||||||
return -ENOIOCTLCMD;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
|
static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
|
||||||
@ -411,7 +411,7 @@ static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
|
|||||||
|
|
||||||
if (port->serial->type->set_serial)
|
if (port->serial->type->set_serial)
|
||||||
return port->serial->type->set_serial(tty, ss);
|
return port->serial->type->set_serial(tty, ss);
|
||||||
return -ENOIOCTLCMD;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int serial_ioctl(struct tty_struct *tty,
|
static int serial_ioctl(struct tty_struct *tty,
|
||||||
|
Loading…
Reference in New Issue
Block a user