]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tty/serial: of_serial: add DT alias ID handling
authorRob Herring <robh@kernel.org>
Tue, 27 Jan 2015 04:50:07 +0000 (22:50 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Feb 2015 18:11:27 +0000 (10:11 -0800)
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>
drivers/tty/serial/of_serial.c

index 64f1bab7e9d75e7bcaeda1ff40bea99d7a928d4e..3194b42c97c0d3c0ecc8be50911706de9e069fe5 100644 (file)
@@ -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) {