summaryrefslogtreecommitdiff
path: root/drivers/video/vidconsole-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-22 02:44:51 (GMT)
committerSimon Glass <sjg@chromium.org>2016-01-22 03:42:36 (GMT)
commitf1a1247d8946ab2bd7efdd8c5197495768ef6269 (patch)
treecafb14c9238a426ab09cf8d013a4c70e9f8091d6 /drivers/video/vidconsole-uclass.c
parent66280e82f7fe90194236da39ab0e2f42869a8070 (diff)
downloadu-boot-fsl-qoriq-f1a1247d8946ab2bd7efdd8c5197495768ef6269.tar.xz
video: Name consoles by their number
We must use the console name in the 'stdout' variable to select the one we want. At present the name is formed from the driver name with a suffix indicating the rotation value. It seems better to name them sequentially since this can be controlled by driver order. So adjust the code to use 'vidconsole' for the first, 'vidconsole1' for the second, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/vidconsole-uclass.c')
-rw-r--r--drivers/video/vidconsole-uclass.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index ea10189..706a189 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -161,7 +161,12 @@ static int vidconsole_post_probe(struct udevice *dev)
struct stdio_dev *sdev = &priv->sdev;
int ret;
- strlcpy(sdev->name, dev->name, sizeof(sdev->name));
+ if (dev->seq) {
+ snprintf(sdev->name, sizeof(sdev->name), "vidconsole%d",
+ dev->seq);
+ } else {
+ strcpy(sdev->name, "vidconsole");
+ }
sdev->flags = DEV_FLAGS_OUTPUT;
sdev->putc = vidconsole_putc;
sdev->puts = vidconsole_puts;