Re: [PATCH 19/19] serdev: Instantiate a ttydev serdev if acpi and of fails

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

 



On Tue, May 29, 2018 at 4:10 PM, Ricardo Ribalda Delgado
<ricardo.ribalda@xxxxxxxxx> wrote:
> If a serdev ttyport controller does not have an acpi nor an of child,
> create a ttydev as a child of that controller.
>
> Doing this allows the removal, addition and replacement of ttydev devices
> at runtime.

> @@ -619,6 +619,27 @@ static inline int acpi_serdev_register_devices(struct serdev_controller *ctrl)
>  }
>  #endif /* CONFIG_ACPI */
>
> +

Redundant blank line.

> +#if IS_ENABLED(CONFIG_SERIAL_DEV_CTRL_TTYDEV)

> -       if (ret_of && ret_acpi) {
> -               dev_dbg(&ctrl->dev, "no devices registered: of:%d acpi:%d\n",
> -                       ret_of, ret_acpi);
> +
> +#if IS_ENABLED(CONFIG_SERIAL_DEV_CTRL_TTYDEV)
> +       if (ret_of && ret_acpi && ctrl->is_ttyport)
> +               ret_tty = serdev_controller_add_ttydev(ctrl);
> +#endif
> +
> +       if (ret_of && ret_acpi && ret_tty) {
> +               dev_dbg(&ctrl->dev,
> +                       "no devices registered: of:%d acpi:%d tty:%d\n",
> +                       ret_of, ret_acpi, ret_tty);
>                 ret = -ENODEV;
>                 goto out_dev_del;
>         }

Wouldn't be better to leave above if-condition and introduce your
stuff inside it?

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux