| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/char/ttyprintk.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010 Samo Pogacnik |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the smems of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; version 2 of the License. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | |
|---|
| 11 | 8 | /* |
|---|
| .. | .. |
|---|
| 38 | 35 | */ |
|---|
| 39 | 36 | #define TPK_STR_SIZE 508 /* should be bigger then max expected line length */ |
|---|
| 40 | 37 | #define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */ |
|---|
| 38 | +#define TPK_PREFIX KERN_SOH __stringify(CONFIG_TTY_PRINTK_LEVEL) |
|---|
| 39 | + |
|---|
| 41 | 40 | static int tpk_curr; |
|---|
| 42 | 41 | |
|---|
| 43 | 42 | static char tpk_buffer[TPK_STR_SIZE + 4]; |
|---|
| .. | .. |
|---|
| 46 | 45 | { |
|---|
| 47 | 46 | if (tpk_curr > 0) { |
|---|
| 48 | 47 | tpk_buffer[tpk_curr] = '\0'; |
|---|
| 49 | | - pr_info("[U] %s\n", tpk_buffer); |
|---|
| 48 | + printk(TPK_PREFIX "[U] %s\n", tpk_buffer); |
|---|
| 50 | 49 | tpk_curr = 0; |
|---|
| 51 | 50 | } |
|---|
| 52 | 51 | } |
|---|
| .. | .. |
|---|
| 184 | 183 | |
|---|
| 185 | 184 | static int __init ttyprintk_init(void) |
|---|
| 186 | 185 | { |
|---|
| 187 | | - int ret = -ENOMEM; |
|---|
| 186 | + int ret; |
|---|
| 188 | 187 | |
|---|
| 189 | 188 | spin_lock_init(&tpk_port.spinlock); |
|---|
| 190 | 189 | |
|---|