summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_imx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial_imx.c')
-rw-r--r--drivers/serial/serial_imx.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index 474bfafff0..e379f29610 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -338,9 +338,11 @@ static int imx_serial_probe(struct device_d *dev)
cdev->flush = imx_serial_flush;
cdev->setbrg = imx_serial_setbaudrate;
cdev->linux_console_name = "ttymxc";
- devname = of_alias_get(dev->device_node);
- if (devname)
- cdev->devname = xstrdup(devname);
+ if (dev->device_node) {
+ devname = of_alias_get(dev->device_node);
+ if (devname)
+ cdev->devname = xstrdup(devname);
+ }
imx_serial_init_port(cdev);