ttynull.c (10205618052908770451acd33eaeaa7685e97ed2) | ttynull.c (a91bd6223ecd46addc71ee6fcd432206d39365d2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2019 Axis Communications AB 4 * | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2019 Axis Communications AB 4 * |
5 * The console is useful for userspace applications which expect a console 6 * device to work without modifications even when no console is available 7 * or desired. 8 * 9 * In order to use this driver, you should redirect the console to this 10 * TTY, or boot the kernel with console=ttynull. 11 * | |
12 * Based on ttyprintk.c: 13 * Copyright (C) 2010 Samo Pogacnik 14 */ 15 16#include <linux/console.h> 17#include <linux/module.h> 18#include <linux/tty.h> 19 --- 41 unchanged lines hidden (view full) --- 61 return ttynull_driver; 62} 63 64static struct console ttynull_console = { 65 .name = "ttynull", 66 .device = ttynull_device, 67}; 68 | 5 * Based on ttyprintk.c: 6 * Copyright (C) 2010 Samo Pogacnik 7 */ 8 9#include <linux/console.h> 10#include <linux/module.h> 11#include <linux/tty.h> 12 --- 41 unchanged lines hidden (view full) --- 54 return ttynull_driver; 55} 56 57static struct console ttynull_console = { 58 .name = "ttynull", 59 .device = ttynull_device, 60}; 61 |
69void __init register_ttynull_console(void) 70{ 71 if (!ttynull_driver) 72 return; 73 74 if (add_preferred_console(ttynull_console.name, 0, NULL)) 75 return; 76 77 register_console(&ttynull_console); 78} 79 | |
80static int __init ttynull_init(void) 81{ 82 struct tty_driver *driver; 83 int ret; 84 85 driver = tty_alloc_driver(1, 86 TTY_DRIVER_RESET_TERMIOS | 87 TTY_DRIVER_REAL_RAW | --- 40 unchanged lines hidden --- | 62static int __init ttynull_init(void) 63{ 64 struct tty_driver *driver; 65 int ret; 66 67 driver = tty_alloc_driver(1, 68 TTY_DRIVER_RESET_TERMIOS | 69 TTY_DRIVER_REAL_RAW | --- 40 unchanged lines hidden --- |