@@ -2474,7 +2474,7 @@ static int tty_tiocsserial(struct tty_struct *tty, struct serial_struct __user *
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,7 +2485,7 @@ static int tty_tiocgserial(struct tty_struct *tty, struct serial_struct __user *
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,15 +2621,9 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
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 );
0 commit comments