]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/serial-8250_pxa-honor-the-port-number-from-devicetre.patch
Linux 4.9.168
[thirdparty/kernel/stable-queue.git] / queue-4.14 / serial-8250_pxa-honor-the-port-number-from-devicetre.patch
1 From 6cb39aa657aac56c018245d7c0457d4340a79c7f Mon Sep 17 00:00:00 2001
2 From: Lubomir Rintel <lkundrak@v3.sk>
3 Date: Sun, 24 Feb 2019 12:58:02 +0100
4 Subject: serial: 8250_pxa: honor the port number from devicetree
5
6 [ Upstream commit fe9ed6d2483fda55465f32924fb15bce0fac3fac ]
7
8 Like the other OF-enabled drivers, use the port number from the firmware if
9 the devicetree specifies an alias:
10
11 aliases {
12 ...
13 serial2 = &uart2; /* Should be ttyS2 */
14 }
15
16 This is how the deprecated pxa.c driver behaved, switching to 8250_pxa
17 messes up the numbering.
18
19 Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 Signed-off-by: Sasha Levin <sashal@kernel.org>
22 ---
23 drivers/tty/serial/8250/8250_pxa.c | 4 ++++
24 1 file changed, 4 insertions(+)
25
26 diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c
27 index 4d68731af534..de1372ba24b1 100644
28 --- a/drivers/tty/serial/8250/8250_pxa.c
29 +++ b/drivers/tty/serial/8250/8250_pxa.c
30 @@ -118,6 +118,10 @@ static int serial_pxa_probe(struct platform_device *pdev)
31 if (ret)
32 return ret;
33
34 + ret = of_alias_get_id(pdev->dev.of_node, "serial");
35 + if (ret >= 0)
36 + uart.port.line = ret;
37 +
38 uart.port.type = PORT_XSCALE;
39 uart.port.iotype = UPIO_MEM32;
40 uart.port.mapbase = mmres->start;
41 --
42 2.19.1
43