提交 f77d55a3 编写于 作者: J Julien CHAUVEAU 提交者: Greg Kroah-Hartman

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: NJulien CHAUVEAU <julien.chauveau@neo-technologies.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1bd83245
...@@ -258,6 +258,7 @@ static int dw8250_probe_of(struct uart_port *p, ...@@ -258,6 +258,7 @@ static int dw8250_probe_of(struct uart_port *p,
struct uart_8250_port *up = up_to_u8250p(p); struct uart_8250_port *up = up_to_u8250p(p);
u32 val; u32 val;
bool has_ucv = true; bool has_ucv = true;
int id;
if (of_device_is_compatible(np, "cavium,octeon-3860-uart")) { if (of_device_is_compatible(np, "cavium,octeon-3860-uart")) {
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
...@@ -301,6 +302,11 @@ static int dw8250_probe_of(struct uart_port *p, ...@@ -301,6 +302,11 @@ static int dw8250_probe_of(struct uart_port *p,
if (!of_property_read_u32(np, "reg-shift", &val)) if (!of_property_read_u32(np, "reg-shift", &val))
p->regshift = 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 */ /* clock got configured through clk api, all done */
if (p->uartclk) if (p->uartclk)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册