[PATCH 2/4] serial: imx: Determine device name from device tree
Sascha Hauer
s.hauer at pengutronix.de
Fri Jul 11 01:02:11 PDT 2014
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/serial/serial_imx.c | 4 ++++
1 file changed, 4 insertions(+)
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);
--
2.0.0
More information about the barebox
mailing list