console simple: return with a proper error value
There can be only one console for console_simple, so return with -EBUSY when the second gets registered. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
c406f59129
commit
d13f42dd3c
|
@ -155,13 +155,15 @@ EXPORT_SYMBOL(ctrlc);
|
|||
|
||||
int console_register(struct console_device *newcdev)
|
||||
{
|
||||
if (!console) {
|
||||
console = newcdev;
|
||||
console_list.prev = console_list.next = &newcdev->list;
|
||||
newcdev->list.prev = newcdev->list.next = &console_list;
|
||||
if (console)
|
||||
return -EBUSY;
|
||||
|
||||
console = newcdev;
|
||||
console_list.prev = console_list.next = &newcdev->list;
|
||||
newcdev->list.prev = newcdev->list.next = &console_list;
|
||||
|
||||
barebox_banner();
|
||||
|
||||
barebox_banner();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue