Skip to contentSkip to conversation

usb serial: Eliminate bogus ioctl code

PATCH New Alan 1 participant 1 message Dec 4, 2006

Subsystems (2)
lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 usb serial: Eliminate bogus ioctl code

Several drivers have bogus ioctl code that tries unneccessarily to override the standard processing. In the three cases here the actual code is not only wrong but also not required as they implement the proper set_termios method as well.

Remove the junk.

drivers/usb/serial/cypress_m8.c +0 -15
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.19-rc6-mm1/drivers/usb/serial/cypress_m8.c linux-2.6.19-rc6-mm1/drivers/usb/serial/cypress_m8.c
@@ -962,21 +962,6 @@
 			cypress_set_termios(port, &priv->tmp_termios);
 			return (0);
 			break;
-		/* these are called when setting baud rate from gpsd */
-		case TCGETS:
-			if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct ktermios))) {
-				return -EFAULT;
-			}
-			return (0);
-			break;
-		case TCSETS:
-			if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct ktermios))) {
-				return -EFAULT;
-			}
-			/* here we need to call cypress_set_termios to invoke the new settings */
-			cypress_set_termios(port, &priv->tmp_termios);
-			return (0);
-			break;
 		/* This code comes from drivers/char/serial.c and ftdi_sio.c */
 		case TIOCMIWAIT:
 			while (priv != NULL) {
drivers/usb/serial/kl5kusb105.c +1 -61

68 lines not on this page · raw message

drivers/usb/serial/mos7840.c +0 -7
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.19-rc6-mm1/drivers/usb/serial/mos7840.c linux-2.6.19-rc6-mm1/drivers/usb/serial/mos7840.c
@@ -2460,13 +2460,6 @@
 		tty_ldisc_deref(ld);
 		return 0;
 
-	/* FIXME: Drivers are not allowed to override TCGETS like this */
-	case TCGETS:
-		if (kernel_termios_to_user_termios
-		    ((struct termios __user *)argp, tty->termios))
-			return -EFAULT;
-		return 0;
-
 	case TIOCSERGETLSR:
 		dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number);
 		return mos7840_get_lsr_info(mos7840_port, argp);