aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/uartlite.c
diff options
context:
space:
mode:
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>2018-10-16 15:48:01 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-09 08:45:07 -0800
commit62104b280a5a5d999c562d8e8f4c6c4eb97fb013 (patch)
tree72713def65b6067ad96923dae95297f78851d05c /drivers/tty/serial/uartlite.c
parentserial-uartlite: Move the uart register (diff)
downloadlinux-dev-62104b280a5a5d999c562d8e8f4c6c4eb97fb013.tar.xz
linux-dev-62104b280a5a5d999c562d8e8f4c6c4eb97fb013.zip
serial-uartlite: Add get serial id if not provided
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/uartlite.c')
-rw-r--r--drivers/tty/serial/uartlite.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 77bc9d0cb8bf..441a216c1be6 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -763,6 +763,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);