Commit acef6660 authored by Peter Korsgaard's avatar Peter Korsgaard Committed by Greg Kroah-Hartman

ttyprintk: make the printk log level configurable

For some use cases it is handy to use a different printk log level than the
default (info) for the messages written to ttyprintk, so add a Kconfig
option similar to what we have for default console loglevel.
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 397bd921
...@@ -66,6 +66,14 @@ config TTY_PRINTK ...@@ -66,6 +66,14 @@ config TTY_PRINTK
If unsure, say N. If unsure, say N.
config TTY_PRINTK_LEVEL
depends on TTY_PRINTK
int "ttyprintk log level (1-7)"
range 1 7
default "6"
help
Printk log level to use for ttyprintk messages.
config PRINTER config PRINTER
tristate "Parallel printer support" tristate "Parallel printer support"
depends on PARPORT depends on PARPORT
......
...@@ -37,6 +37,8 @@ static struct ttyprintk_port tpk_port; ...@@ -37,6 +37,8 @@ static struct ttyprintk_port tpk_port;
*/ */
#define TPK_STR_SIZE 508 /* should be bigger then max expected line length */ #define TPK_STR_SIZE 508 /* should be bigger then max expected line length */
#define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */ #define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */
#define TPK_PREFIX KERN_SOH __stringify(CONFIG_TTY_PRINTK_LEVEL)
static int tpk_curr; static int tpk_curr;
static char tpk_buffer[TPK_STR_SIZE + 4]; static char tpk_buffer[TPK_STR_SIZE + 4];
...@@ -45,7 +47,7 @@ static void tpk_flush(void) ...@@ -45,7 +47,7 @@ static void tpk_flush(void)
{ {
if (tpk_curr > 0) { if (tpk_curr > 0) {
tpk_buffer[tpk_curr] = '\0'; tpk_buffer[tpk_curr] = '\0';
pr_info("[U] %s\n", tpk_buffer); printk(TPK_PREFIX "[U] %s\n", tpk_buffer);
tpk_curr = 0; tpk_curr = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment