aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb_debug.c
diff options
context:
space:
mode:
authorJohan Hovold <[email protected]>2023-06-04 12:35:03 +0000
committerJohan Hovold <[email protected]>2023-06-07 15:00:23 +0000
commit6ff58ae17fd9523246a260434133ed9ab7f56df2 (patch)
tree286bf3fdeec1bef50a64f4597deef90c55f1c82f /drivers/usb/serial/usb_debug.c
parentLinux 6.4-rc5 (diff)
downloadkernel-6ff58ae17fd9523246a260434133ed9ab7f56df2.tar.gz
kernel-6ff58ae17fd9523246a260434133ed9ab7f56df2.zip
USB: serial: return errors from break handling
Start propagating errors to user space when setting the break state fails. This will be used by follow-on changes to also report when a driver or device does not support break control. Tested-by: Corey Minyard <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
Diffstat (limited to 'drivers/usb/serial/usb_debug.c')
-rw-r--r--drivers/usb/serial/usb_debug.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c
index aaf4813e4971..6934970f180d 100644
--- a/drivers/usb/serial/usb_debug.c
+++ b/drivers/usb/serial/usb_debug.c
@@ -47,12 +47,19 @@ MODULE_DEVICE_TABLE(usb, id_table_combined);
/* This HW really does not support a serial break, so one will be
* emulated when ever the break state is set to true.
*/
-static void usb_debug_break_ctl(struct tty_struct *tty, int break_state)
+static int usb_debug_break_ctl(struct tty_struct *tty, int break_state)
{
struct usb_serial_port *port = tty->driver_data;
+ int ret;
+
if (!break_state)
- return;
- usb_serial_generic_write(tty, port, USB_DEBUG_BRK, USB_DEBUG_BRK_SIZE);
+ return 0;
+
+ ret = usb_serial_generic_write(tty, port, USB_DEBUG_BRK, USB_DEBUG_BRK_SIZE);
+ if (ret < 0)
+ return ret;
+
+ return 0;
}
static void usb_debug_process_read_urb(struct urb *urb)