Re: [PATCH] tty: implement a rx led trigger

Robin Murphy
2018-05-03T12:33:10Z

On 03/05/18 11:04, Uwe Kleine-König wrote:
[...]
> @@ -157,6 +158,18 @@ struct device *tty_port_register_device_attr_serdev(struct tty_port *port,
>
> tty_port_link_device(port, driver, index);
>
> + port->led_trigger_rx_name = kasprintf(GFP_KERNEL, "%s%d-rx",
> + driver->name, index);
> + if (!port->led_trigger_rx_name) {
> + pr_err("Failed to allocate trigger name for %s%d\n",
> + driver->name, index);
> + goto skip_trigger;

Hmm, isn't that a rather awkward way to spell "else"? ;)

Robin.

> + }
> +
> + led_trigger_register_simple(port->led_trigger_rx_name,
> + &port->led_trigger_rx);
> +
> +skip_trigger:
> dev = serdev_tty_port_register(port, device, driver, index);
> if (PTR_ERR(dev) != -ENODEV) {
> /* Skip creating cdev if we registered a serdev device */