summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorJulien CHAUVEAU <julien.chauveau@neo-technologies.fr>2014-11-04 11:45:55 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-06 14:57:26 -0800
commitf77d55a3b56a98d14b6e7dc549c24b33011d175d (patch)
tree5b99bdff6bb16f6a9275a1cb513492a1d2eed574 /drivers/tty
parent1bd8324535ec1ff44aef55c0e40b9e7d56b310fb (diff)
serial: 8250_dw: get index of serial line from DT aliases
Get index of serial line from device tree using function of_alias_get_id(). If no alias is found, the 8250 core takes care of incrementing the line number. Signed-off-by: Julien CHAUVEAU <julien.chauveau@neo-technologies.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_dw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 73a14ae8f0ae..18ff53298d2f 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -258,6 +258,7 @@ static int dw8250_probe_of(struct uart_port *p,
struct uart_8250_port *up = up_to_u8250p(p);
u32 val;
bool has_ucv = true;
+ int id;
if (of_device_is_compatible(np, "cavium,octeon-3860-uart")) {
#ifdef __BIG_ENDIAN
@@ -301,6 +302,11 @@ static int dw8250_probe_of(struct uart_port *p,
if (!of_property_read_u32(np, "reg-shift", &val))
p->regshift = val;
+ /* get index of serial line, if found in DT aliases */
+ id = of_alias_get_id(np, "serial");
+ if (id >= 0)
+ p->line = id;
+
/* clock got configured through clk api, all done */
if (p->uartclk)
return 0;