From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] console: Allow persistent device names
Date: Fri, 11 Jul 2014 10:02:10 +0200 [thread overview]
Message-ID: <1405065733-31407-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1405065733-31407-1-git-send-email-s.hauer@pengutronix.de>
Add a devname field to struct console_device so that the device
name can be set by the driver. This makes it possible to have
persistent device names.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/console.c | 10 ++++++++--
include/console.h | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/common/console.c b/common/console.c
index aa9e3ce..f982366 100644
--- a/common/console.c
+++ b/common/console.c
@@ -170,8 +170,14 @@ int console_register(struct console_device *newcdev)
if (initialized == CONSOLE_UNINITIALIZED)
console_init_early();
- dev->id = DEVICE_ID_DYNAMIC;
- strcpy(dev->name, "cs");
+ if (newcdev->devname) {
+ dev->id = DEVICE_ID_SINGLE;
+ strcpy(dev->name, newcdev->devname);
+ } else {
+ dev->id = DEVICE_ID_DYNAMIC;
+ strcpy(dev->name, "cs");
+ }
+
if (newcdev->dev)
dev->parent = newcdev->dev;
platform_device_register(dev);
diff --git a/include/console.h b/include/console.h
index 6da0199..7535a56 100644
--- a/include/console.h
+++ b/include/console.h
@@ -44,6 +44,8 @@ struct console_device {
void (*flush)(struct console_device *cdev);
int (*set_mode)(struct console_device *cdev, enum console_mode mode);
+ char *devname;
+
struct list_head list;
unsigned char f_active;
--
2.0.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev 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 ` Sascha Hauer [this message]
2014-07-11 8:02 ` [PATCH 2/4] serial: imx: Determine device name from device tree Sascha Hauer
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-2-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