summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2018-12-19 11:03:57 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2018-12-20 08:57:31 +0100
commita2ce24f9bc1149f5374de1b0c7d27bf8ec4c29ae (patch)
tree325afe11ac5aa2dbbbb9be0863caf2f0aae6e67d /drivers/serial
parentb146df65c7d6d4774a42f5f55d9dd28ed44c0b0c (diff)
downloadbarebox-a2ce24f9bc1149f5374de1b0c7d27bf8ec4c29ae.tar.gz
serial: clps711x: Determine device name from device tree
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/serial_clps711x.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/serial/serial_clps711x.c b/drivers/serial/serial_clps711x.c
index 85a96ed..7a7d595 100644
--- a/drivers/serial/serial_clps711x.c
+++ b/drivers/serial/serial_clps711x.c
@@ -124,6 +124,7 @@ static int clps711x_probe(struct device_d *dev)
struct clps711x_uart *s;
int err, id = dev->id;
char syscon_dev[8];
+ const char *devname;
if (dev->device_node)
id = of_alias_get_id(dev->device_node, "serial");
@@ -162,6 +163,14 @@ static int clps711x_probe(struct device_d *dev)
s->cdev.getc = clps711x_getc;
s->cdev.flush = clps711x_flush;
s->cdev.setbrg = clps711x_setbaudrate;
+ s->cdev.linux_console_name = "ttyCL";
+
+ devname = of_alias_get(dev->device_node);
+ if (devname) {
+ s->cdev.devname = xstrdup(devname);
+ s->cdev.devid = DEVICE_ID_SINGLE;
+ }
+
clps711x_init_port(&s->cdev);
err = console_register(&s->cdev);