mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <shc_work@mail.ru>
To: barebox@lists.infradead.org
Subject: [PATCH 04/10] serial: clps711x: Determine device name from device tree
Date: Wed, 19 Dec 2018 11:03:57 +0300	[thread overview]
Message-ID: <20181219080403.13737-4-shc_work@mail.ru> (raw)
In-Reply-To: <20181219080403.13737-1-shc_work@mail.ru>

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/serial/serial_clps711x.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/serial/serial_clps711x.c b/drivers/serial/serial_clps711x.c
index 863ba7dd3..d4f674afd 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);
-- 
2.13.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-12-19  8:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19  8:03 [PATCH 01/10] serial: clps711x: Change compatible string Alexander Shiyan
2018-12-19  8:03 ` [PATCH 02/10] serial: clps711x: Switch to SPDX identifier Alexander Shiyan
2019-01-04 10:46   ` Roland Hieber
2019-01-04 10:48     ` Roland Hieber
2019-01-08 10:45       ` Alexander Shiyan
2018-12-19  8:03 ` [PATCH 03/10] serial: clps711x: Use DIV_ROUND_CLOSEST() for baudrate calculation Alexander Shiyan
2018-12-19  8:03 ` Alexander Shiyan [this message]
2018-12-19  8:03 ` [PATCH 05/10] gpio: clps711x: Change compatible string Alexander Shiyan
2018-12-19  8:03 ` [PATCH 06/10] gpio: clps711x: Switch to SPDX identifier Alexander Shiyan
2018-12-19  8:04 ` [PATCH 07/10] gpio: clps711x: Use coredevice_platform_driver() macro Alexander Shiyan
2018-12-19  8:04 ` [PATCH 08/10] clocksource: clps711x: Add devicetree support Alexander Shiyan
2018-12-19  8:04 ` [PATCH 09/10] clocksource: clps711x: Switch to SPDX identifier Alexander Shiyan
2018-12-19  8:04 ` [PATCH 10/10] clocksource: clps711x: Use coredevice_platform_driver() macro Alexander Shiyan
2018-12-20  7:57 ` [PATCH 01/10] serial: clps711x: Change compatible string Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181219080403.13737-4-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox