Skip to content

Commit 1bd8324

Browse files
lynxeye-devgregkh
authored andcommitted
serial: of-serial: fetch line number from DT
The general agreed way to specify a fixed line number for a serial console is to provide a "serial" alias in the devicetree. Start parsing this property in of_serial. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5d14bba commit 1bd8324

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/tty/serial/of_serial.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
102102
if (of_property_read_u32(np, "fifo-size", &prop) == 0)
103103
port->fifosize = prop;
104104

105+
/* Check for a fixed line number */
106+
if ((ret = of_alias_get_id(np, "serial")) >= 0)
107+
port->line = ret;
108+
105109
port->irq = irq_of_parse_and_map(np, 0);
106110
port->iotype = UPIO_MEM;
107111
if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {

0 commit comments

Comments
 (0)