9f4e21aab5fe9ea2295102fb733bcfdabd70d340
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-4.4 / 000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch
1 From a59388668d0ce19dadea909e09f4eb905a27b1ce Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Wed, 8 Jun 2016 12:08:43 +0200
4 Subject: [PATCH] serial/bcm63xx_uart: use correct alias naming
5
6 The bcm63xx_uart driver uses the of alias for determing its id. Recent
7 changes in dts files changed the expected 'uartX' to the recommended
8 'serialX', breaking serial output. Fix this by checking for a 'serialX'
9 alias as well.
10
11 Fixes: e3b992d028f8 ("MIPS: BMIPS: Improve BCM6328 device tree")
12 Fixes: 2d52ee82b475 ("MIPS: BMIPS: Improve BCM6368 device tree")
13 Fixes: 7537d273e2f3 ("MIPS: BMIPS: Add device tree example for BCM6358")
14 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
15 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 ---
18 drivers/tty/serial/bcm63xx_uart.c | 8 ++++++--
19 1 file changed, 6 insertions(+), 2 deletions(-)
20
21 --- a/drivers/tty/serial/bcm63xx_uart.c
22 +++ b/drivers/tty/serial/bcm63xx_uart.c
23 @@ -813,8 +813,12 @@ static int bcm_uart_probe(struct platfor
24 struct clk *clk;
25 int ret;
26
27 - if (pdev->dev.of_node)
28 - pdev->id = of_alias_get_id(pdev->dev.of_node, "uart");
29 + if (pdev->dev.of_node) {
30 + pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
31 +
32 + if (pdev->id < 0)
33 + pdev->id = of_alias_get_id(pdev->dev.of_node, "uart");
34 + }
35
36 if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS)
37 return -EINVAL;