diff options
author | Rob Herring <robh@kernel.org> | 2015-01-26 22:50:07 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-02-02 10:11:27 -0800 |
commit | 6d01bb9dc82a60580f749062a48cb47cd5caca07 (patch) | |
tree | 5b916ccdc960519a8397da9d060863bd42c9699f | |
parent | e9cef8625e997a5ade9cddd2d501257dfee7cb62 (diff) | |
download | linux-6d01bb9dc82a60580f749062a48cb47cd5caca07.tar.gz linux-6d01bb9dc82a60580f749062a48cb47cd5caca07.tar.bz2 linux-6d01bb9dc82a60580f749062a48cb47cd5caca07.zip |
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 <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>
-rw-r--r-- | drivers/tty/serial/of_serial.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |