USB: serial: report unsupported break signalling
authorJohan Hovold <johan@kernel.org>
Sun, 4 Jun 2023 12:35:05 +0000 (14:35 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 7 Jun 2023 15:00:24 +0000 (17:00 +0200)
Instead of returning success when a driver does not support break
signalling, return an error to let user space know and to avoid waiting
when break is not supported.

Tested-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/usb-serial.c

index 4706344..7b4805c 100644 (file)
@@ -541,7 +541,7 @@ static int serial_break(struct tty_struct *tty, int break_state)
        if (port->serial->type->break_ctl)
                return port->serial->type->break_ctl(tty, break_state);
 
-       return 0;
+       return -ENOTTY;
 }
 
 static int serial_proc_show(struct seq_file *m, void *v)