[U-Boot] [PATCH 5/9] serial: s5p: get the port id number from the alias of the device node

Simon Glass sjg at chromium.org
Wed Apr 20 16:41:03 CEST 2016


Hi Thomas,

On 13 April 2016 at 04:43, Thomas Abraham <ta.omasab at gmail.com> wrote:
> From: Thomas Abraham <thomas.ab at samsung.com>
>
> The port id, if not specified in the device node, can be obtained from
> the alias of the device node listed in the aliases node.
>
> Cc: Minkyu Kang <mk7.kang at samsung.com>
> Signed-off-by: Thomas Abraham <thomas.ab at samsung.com>
> ---
>  drivers/serial/serial_s5p.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
> index feba467..038d9b6 100644
> --- a/drivers/serial/serial_s5p.c
> +++ b/drivers/serial/serial_s5p.c
> @@ -175,6 +175,8 @@ static int s5p_serial_ofdata_to_platdata(struct udevice *dev)
>
>         plat->reg = (struct s5p_uart *)addr;
>         plat->port_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "id", -1);
> +       if (plat->port_id == -1)
> +               plat->port_id = dev->seq;

Then why not:

        plat->port_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
"id", dev->seq);

>
>         return 0;
>  }
> --
> 1.6.6.rc2
>

Regards,
Simon


More information about the U-Boot mailing list