/* Spinlock to protect the tty->tty_files list */
DEFINE_SPINLOCK(tty_files_lock);
+bool __read_mostly console_use_vt = true;
+
static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *);
ssize_t redirected_tty_write(struct file *, const char __user *,
#ifdef CONFIG_VT
case MKDEV(TTY_MAJOR, 0): {
extern struct tty_driver *console_driver;
+
+ if (!console_use_vt)
+ return get_tty_driver(device, index)
+ ?: ERR_PTR(-ENODEV);
driver = tty_driver_kref_get(console_driver);
*index = fg_console;
*noctty = 1;
WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
#ifdef CONFIG_VT
- vty_init(&console_fops);
+ if (console_use_vt)
+ vty_init(&console_fops);
#endif
return 0;
}