mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] serial: imx: Determine device name from device tree
Date: Fri, 11 Jul 2014 10:02:11 +0200	[thread overview]
Message-ID: <1405065733-31407-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1405065733-31407-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@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


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

  parent reply	other threads:[~2014-07-11  8:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11  8:02 [PATCH] persistent device names for console devices Sascha Hauer
2014-07-11  8:02 ` [PATCH 1/4] console: Allow persistent device names Sascha Hauer
2014-07-11  8:02 ` Sascha Hauer [this message]
2014-07-11  8:02 ` [PATCH 3/4] netconsole: rename console to "netconsole" Sascha Hauer
2014-07-11  8:02 ` [PATCH 4/4] usb: usbserial gadget: Add persistent device name 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=1405065733-31407-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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