summaryrefslogtreecommitdiff
path: root/drivers/console
diff options
context:
space:
mode:
authorAmbroise Vincent <ambroise.vincent@arm.com>2019-04-18 11:36:42 +0100
committerAmbroise Vincent <ambroise.vincent@arm.com>2019-04-24 10:50:16 +0100
commit71892ca3315233d3514275de83c7e5a0e3b4533f (patch)
tree900f9edf0debf56771ff41dc27dc2772afbd8734 /drivers/console
parentd87af648a24f3074a5d8165055bde11bdc5ccb72 (diff)
Console: Allow to register multiple times
It removes the need to unregister the console on system suspend. Change-Id: Ic9311a242a4a9a778651f7e6380bd2fc0964b2ce Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
Diffstat (limited to 'drivers/console')
-rw-r--r--drivers/console/multi_console.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/console/multi_console.c b/drivers/console/multi_console.c
index b5ff88b7..1ec81c3c 100644
--- a/drivers/console/multi_console.c
+++ b/drivers/console/multi_console.c
@@ -20,8 +20,10 @@ int console_register(console_t *console)
{
/* Assert that the struct is not on the stack (common mistake). */
assert((console < stacks_start) || (console >= stacks_end));
- /* Assert that we won't make a circle in the list. */
- assert(!console_is_registered(console));
+
+ /* Check that we won't make a circle in the list. */
+ if (console_is_registered(console) == 1)
+ return 1;
console->next = console_list;
console_list = console;