Skip to content

Commit

Permalink
tty/serial: of_serial: add DT alias ID handling
Browse files Browse the repository at this point in the history
Add support for alias parsing from the DT. This allows for consistent
tty numbering.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Rob Herring authored and Greg Kroah-Hartman committed Feb 2, 2015
1 parent e9cef86 commit 6d01bb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/tty/serial/of_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6d01bb9

Please sign in to comment.