9
0
Fork 0

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:
Sascha Hauer 2012-01-26 14:16:09 +01:00
parent c406f59129
commit d13f42dd3c
1 changed files with 8 additions and 6 deletions

View File

@ -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;
}