From: Rob Herring Date: Tue, 27 Jan 2015 04:50:07 +0000 (-0600) Subject: tty/serial: of_serial: add DT alias ID handling X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=6d01bb9dc82a60580f749062a48cb47cd5caca07;p=deliverable%2Flinux.git tty/serial: of_serial: add DT alias ID handling Add support for alias parsing from the DT. This allows for consistent tty numbering. Signed-off-by: Rob Herring Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index 64f1bab7e9d7..3194b42c97c0 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -128,6 +128,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev, if (of_find_property(np, "no-loopback-test", NULL)) port->flags |= UPF_SKIP_TEST; + ret = of_alias_get_id(np, "serial"); + if (ret >= 0) + port->line = ret; + port->dev = &ofdev->dev; switch (type) {