blk: rq_data_dir() should not return a boolean
[cris-mirror.git] / arch / um / kernel / kmsg_dump.c
blob407d49251d6f98642ad815c8b5cafa7ef3d4c7aa
1 #include <linux/kmsg_dump.h>
2 #include <linux/console.h>
3 #include <shared/init.h>
4 #include <shared/kern.h>
5 #include <os.h>
7 static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
8 enum kmsg_dump_reason reason)
10 static char line[1024];
12 size_t len = 0;
13 bool con_available = false;
15 /* only dump kmsg when no console is available */
16 if (!console_trylock())
17 return;
19 if (console_drivers != NULL)
20 con_available = true;
22 console_unlock();
24 if (con_available == true)
25 return;
27 printf("kmsg_dump:\n");
28 while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) {
29 line[len] = '\0';
30 printf("%s", line);
34 static struct kmsg_dumper kmsg_dumper = {
35 .dump = kmsg_dumper_stdout
38 int __init kmsg_dumper_stdout_init(void)
40 return kmsg_dump_register(&kmsg_dumper);
43 __uml_postsetup(kmsg_dumper_stdout_init);