summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-08 15:04:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-11 09:58:41 +0200
commit3843bfd0ab77eaf125ca617922927b61fc8ded74 (patch)
treef85b30b70e9692b4a910cf9aef70cdd4d4b26261 /drivers/serial/serial_imx.c
parent9c4f107c35a77c12a70f5b9aa36600a75b93b358 (diff)
downloadbarebox-3843bfd0ab77eaf125ca617922927b61fc8ded74.tar.gz
serial: imx: Determine device name from device tree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/serial_imx.c')
-rw-r--r--drivers/serial/serial_imx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index cb10627..474bfaf 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -313,6 +313,7 @@ static int imx_serial_probe(struct device_d *dev)
uint32_t val;
struct imx_serial_devtype_data *devtype;
int ret;
+ const char *devname;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype);
if (ret)
@@ -337,6 +338,9 @@ 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);
imx_serial_init_port(cdev);