Skip to content

Commit

Permalink
serial: 8250_dw: get index of serial line from DT aliases
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julien CHAUVEAU authored and Greg Kroah-Hartman committed Nov 6, 2014
1 parent 1bd8324 commit f77d55a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/tty/serial/8250/8250_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f77d55a

Please sign in to comment.