summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-08 15:02:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-11 09:58:36 +0200
commit9c4f107c35a77c12a70f5b9aa36600a75b93b358 (patch)
treebecc38a41aa925f67bb2f4f4557c8a0e98805cd0 /common/console.c
parent239b6559ed5d65cc3e08eae66eb862fefe651e33 (diff)
downloadbarebox-9c4f107c35a77c12a70f5b9aa36600a75b93b358.tar.gz
console: Allow persistent device names
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>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c10
1 files changed, 8 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);