summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/pl2303.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-03-21 12:37:44 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 13:54:31 -0700
commitaff5b323b319758257a838cdc45f494c6674447c (patch)
treeceeaa976b27f9f42451fe69d185afb404a4ef9fd /drivers/usb/serial/pl2303.c
parent94bcef624548fd2bcf94cb7f9fcbaedbd96d5742 (diff)
USB: pl2303: fix return value of tiocmset
Make sure we return 0 or a negative error number appropriate for userspace on errors. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/pl2303.c')
-rw-r--r--drivers/usb/serial/pl2303.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 997eba4dcbeb..4dff17902fa0 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -550,10 +550,13 @@ static int pl2303_tiocmset(struct tty_struct *tty,
spin_unlock_irqrestore(&priv->lock, flags);
mutex_lock(&serial->disc_mutex);
- if (!serial->disconnected)
+ if (!serial->disconnected) {
ret = pl2303_set_control_lines(port, control);
- else
+ if (ret)
+ ret = usb_translate_errors(ret);
+ } else {
ret = -ENODEV;
+ }
mutex_unlock(&serial->disc_mutex);
return ret;