]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
serial-uartlite: Add get serial id if not provided
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Thu, 4 Oct 2018 14:37:33 +0000 (20:07 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 5 Oct 2018 09:34:40 +0000 (11:34 +0200)
Add get serial id if not provided

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/tty/serial/uartlite.c

index 6aadbd00112dc3a7726b49aaabda937c7e66fe9e..0429ee9da2c61fd3f842471469a1db9261b947cb 100644 (file)
@@ -764,6 +764,13 @@ static int ulite_probe(struct platform_device *pdev)
        if (prop)
                id = be32_to_cpup(prop);
 #endif
+       if (id < 0) {
+               /* Look for a serialN alias */
+               id = of_alias_get_id(pdev->dev.of_node, "serial");
+               if (id < 0)
+                       id = 0;
+       }
+
        if (!ulite_uart_driver.state) {
                dev_dbg(&pdev->dev, "uartlite: calling uart_register_driver()\n");
                ret = uart_register_driver(&ulite_uart_driver);