Commit dbe24815 authored by Richard Ash's avatar Richard Ash Committed by Greg Kroah-Hartman

Staging: quatech_usb2: TIOCMGET and TIOCMSET removal

Patch to remove TIOCMGET and TIOCMSET from the driver ioctl method, as
they never get used (error in vendor driver).
Signed-off-by: default avatarRichard Ash <richard@audacityteam.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89b5098d
...@@ -860,7 +860,10 @@ static int qt2_chars_in_buffer(struct tty_struct *tty) ...@@ -860,7 +860,10 @@ static int qt2_chars_in_buffer(struct tty_struct *tty)
return chars; return chars;
} }
/* called when userspace does an ioctl() on the device. Note that
* TIOCMGET and TIOCMSET are filtered off to their own methods before they get
* here, so we don't have to handle them.
*/
static int qt2_ioctl(struct tty_struct *tty, struct file *file, static int qt2_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
...@@ -887,22 +890,12 @@ static int qt2_ioctl(struct tty_struct *tty, struct file *file, ...@@ -887,22 +890,12 @@ static int qt2_ioctl(struct tty_struct *tty, struct file *file,
dbg("%s(): port %d, UartNumber %d, tty =0x%p", __func__, dbg("%s(): port %d, UartNumber %d, tty =0x%p", __func__,
port->number, UartNumber, tty); port->number, UartNumber, tty);
if (cmd == TIOCMGET) { if (cmd == TIOCMBIS || cmd == TIOCMBIC) {
return qt2_tiocmget(tty, file); if (qt2_box_get_register(port->serial, UartNumber,
/* same as tiocmget function */ QT2_MODEM_CONTROL_REGISTER, &mcr_value) < 0)
} else if (cmd == TIOCMSET) {
if (copy_from_user(&value, (unsigned int *)arg,
sizeof(unsigned int)))
return -EFAULT;
return qt2_tiocmset(tty, file, value, 0);
/* same as tiocmset function */
} else if (cmd == TIOCMBIS || cmd == TIOCMBIC) {
status = qt2_box_get_register(port->serial, UartNumber,
QT2_MODEM_CONTROL_REGISTER, &mcr_value);
if (status < 0)
return -ESPIPE; return -ESPIPE;
if (copy_from_user(&value, (unsigned int *)arg, if (copy_from_user(&value, (unsigned int *)arg,
sizeof(unsigned int))) sizeof(value)))
return -EFAULT; return -EFAULT;
switch (cmd) { switch (cmd) {
...@@ -925,9 +918,8 @@ static int qt2_ioctl(struct tty_struct *tty, struct file *file, ...@@ -925,9 +918,8 @@ static int qt2_ioctl(struct tty_struct *tty, struct file *file,
default: default:
break; break;
} /* end of local switch on cmd */ } /* end of local switch on cmd */
status = qt2_box_set_register(port->serial, UartNumber, if (qt2_box_set_register(port->serial, UartNumber,
QT2_MODEM_CONTROL_REGISTER, mcr_value); QT2_MODEM_CONTROL_REGISTER, mcr_value) < 0) {
if (status < 0) {
return -ESPIPE; return -ESPIPE;
} else { } else {
port_extra->shadowMCR = mcr_value; port_extra->shadowMCR = mcr_value;
...@@ -965,6 +957,10 @@ static int qt2_ioctl(struct tty_struct *tty, struct file *file, ...@@ -965,6 +957,10 @@ static int qt2_ioctl(struct tty_struct *tty, struct file *file,
return 0; return 0;
} }
} /* end inifinite while */ } /* end inifinite while */
/* FIXME: This while loop needs a way to break out if the device
* is disconnected while a process is waiting for the MSR to
* change, because once it's disconnected, it isn't going to
* change state ... */
} else { } else {
/* any other ioctls we don't know about come here */ /* any other ioctls we don't know about come here */
dbg("%s(): No ioctl for that one. port = %d", __func__, dbg("%s(): No ioctl for that one. port = %d", __func__,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment