diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-07 12:03:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-07 12:03:13 +0100 |
commit | 0ee6847f7b6d396d3756f6ecd0781a00b9cca980 (patch) | |
tree | 1f1bed639ac0bbc9091685538c791b4648f4c342 /common/console.c | |
parent | 61b62f6d33d55c9b89ba8a6fbae84cb9c33e342a (diff) | |
parent | 8b3d10265da20b8be6138799cee704d53dee1c63 (diff) | |
download | barebox-0ee6847f7b6d396d3756f6ecd0781a00b9cca980.tar.gz barebox-0ee6847f7b6d396d3756f6ecd0781a00b9cca980.tar.xz |
Merge branch 'next'
Diffstat (limited to 'common/console.c')
-rw-r--r-- | common/console.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/common/console.c b/common/console.c index e5c0581381..cab8689252 100644 --- a/common/console.c +++ b/common/console.c @@ -154,13 +154,9 @@ int console_register(struct console_device *newcdev) list_add_tail(&newcdev->list, &console_list); - if (console_output_buffer) { - while (kfifo_getc(console_output_buffer, &ch) == 0) - console_putc(CONSOLE_STDOUT, ch); - kfifo_free(console_output_buffer); - console_output_buffer = NULL; - } + while (kfifo_getc(console_output_buffer, &ch) == 0) + console_putc(CONSOLE_STDOUT, ch); if (first) barebox_banner(); @@ -168,6 +164,22 @@ int console_register(struct console_device *newcdev) } EXPORT_SYMBOL(console_register); +int console_unregister(struct console_device *cdev) +{ + struct device_d *dev = &cdev->class_dev; + int status; + + list_del(&cdev->list); + if (list_empty(&console_list)) + initialized = CONSOLE_UNINITIALIZED; + + status = unregister_device(dev); + if (!status) + memset(cdev, 0, sizeof(*cdev)); + return status; +} +EXPORT_SYMBOL(console_unregister); + static int getc_raw(void) { struct console_device *cdev; |