question on correct error return from break_ctl()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

it seems inconsistent. The tty layer
in drivers/tty/tty_io.c::send_break()

static int send_break(struct tty_struct *tty, unsigned int duration)
{
        int retval;

        if (tty->ops->break_ctl == NULL)
                return 0;

not supporting break_ctl() is treated as the operation
succeeding. Yet in drivers/usb/serial/usb-serial.c::serial_break()

static int serial_break(struct tty_struct *tty, int break_state)
{
        struct usb_serial_port *port = tty->driver_data;

        dev_dbg(&port->dev, "%s\n", __func__);

        if (port->serial->type->break_ctl)
                return port->serial->type->break_ctl(tty, break_state);

        return -ENOTTY;
}

we are seeing that not supporting break_ctl() leads to returning
-ENOTTY, which drivers/tty/tty_io.c::send_break() will return to user space.
These reactions are at odds with each other. What is a driver supposed
to do?

	Regards
		Oliver




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux