Skip to content

Commit 930236a

Browse files
author
Al Viro
committed
complete ->[sg]et_serial() switchover
Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 15cc7ba commit 930236a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

drivers/tty/tty_io.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,7 @@ static int tty_tiocsserial(struct tty_struct *tty, struct serial_struct __user *
24742474
pr_warn("%s: '%s' is using deprecated serial flags (with no effect): %.8x\n",
24752475
__func__, get_task_comm(comm, current), flags);
24762476
if (!tty->ops->set_serial)
2477-
return -ENOIOCTLCMD;
2477+
return -ENOTTY;
24782478
return tty->ops->set_serial(tty, &v);
24792479
}
24802480

@@ -2485,7 +2485,7 @@ static int tty_tiocgserial(struct tty_struct *tty, struct serial_struct __user *
24852485

24862486
memset(&v, 0, sizeof(struct serial_struct));
24872487
if (!tty->ops->get_serial)
2488-
return -ENOIOCTLCMD;
2488+
return -ENOTTY;
24892489
err = tty->ops->get_serial(tty, &v);
24902490
if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
24912491
err = -EFAULT;
@@ -2621,15 +2621,9 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
26212621
}
26222622
break;
26232623
case TIOCSSERIAL:
2624-
retval = tty_tiocsserial(tty, p);
2625-
if (retval != -ENOIOCTLCMD)
2626-
return retval;
2627-
break;
2624+
return tty_tiocsserial(tty, p);
26282625
case TIOCGSERIAL:
2629-
retval = tty_tiocgserial(tty, p);
2630-
if (retval != -ENOIOCTLCMD)
2631-
return retval;
2632-
break;
2626+
return tty_tiocgserial(tty, p);
26332627
case TIOCGPTPEER:
26342628
/* Special because the struct file is needed */
26352629
return ptm_open_peer(file, tty, (int)arg);

drivers/usb/serial/usb-serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
402402

403403
if (port->serial->type->get_serial)
404404
return port->serial->type->get_serial(tty, ss);
405-
return -ENOIOCTLCMD;
405+
return -ENOTTY;
406406
}
407407

408408
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)
411411

412412
if (port->serial->type->set_serial)
413413
return port->serial->type->set_serial(tty, ss);
414-
return -ENOIOCTLCMD;
414+
return -ENOTTY;
415415
}
416416

417417
static int serial_ioctl(struct tty_struct *tty,

0 commit comments

Comments
 (0)