diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-05-31 18:12:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-06-01 09:42:48 +0200 |
commit | a8de37dbef75665b6bdd98e9ce54f9fb20484785 (patch) | |
tree | 6bcd4797317fa8ddc77ffc3a67ce3ccaebda4cc6 /arch/sandbox/board | |
parent | 44ae52f30ff074be01214a3a77495a1c248ac02a (diff) | |
download | barebox-a8de37dbef75665b6bdd98e9ce54f9fb20484785.tar.gz barebox-a8de37dbef75665b6bdd98e9ce54f9fb20484785.tar.xz |
sandbox: fix registering multiple consoles
Consoles need to be registered with the "console" device name so that
they are probed by the correct driver. The barebox_register_console()
was already forcing this as it was overwriting the name that was being
passed as argument, but it was failing to provide a unique id for
each new console, so the underlying register_device() would just
return an error when wanting to re-register a device with device name
"console" and id 0.
We remove the unused name parameter from barebox_register_console() as
it is really nowhere used, and also specify DEVICE_ID_DYNAMIC as id,
so that a new unique device id is given to each newly registered
console device.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/board')
-rw-r--r-- | arch/sandbox/board/console.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/sandbox/board/console.c b/arch/sandbox/board/console.c index cd5ad57235..cf1781d156 100644 --- a/arch/sandbox/board/console.c +++ b/arch/sandbox/board/console.c @@ -22,7 +22,7 @@ #include <mach/linux.h> #include <xfuncs.h> -int barebox_register_console(char *name, int stdinfd, int stdoutfd) +int barebox_register_console(int stdinfd, int stdoutfd) { struct device_d *dev; struct linux_console_data *data; @@ -32,9 +32,8 @@ int barebox_register_console(char *name, int stdinfd, int stdoutfd) data = (struct linux_console_data *)(dev + 1); dev->platform_data = data; - strcpy(dev->name, name); - strcpy(dev->name, "console"); + dev->id = DEVICE_ID_DYNAMIC; data->stdoutfd = stdoutfd; data->stdinfd = stdinfd; |