From: Antonino A. Daplas Date: Mon, 26 Jun 2006 07:27:12 +0000 (-0700) Subject: [PATCH] VT binding: Make VT binding a Kconfig option X-Git-Tag: v2.6.18-rc1~677 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=13ae66458971b4967350765a8bfaf2a636442e5f;p=cascardo%2Flinux.git [PATCH] VT binding: Make VT binding a Kconfig option To enable this feature, CONFIG_VT_HW_CONSOLE_BINDING must be set to 'y'. This feature will default to 'n' to minimize users accidentally corrupting their virtual terminals. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index ed31638bd75c..3610c5729553 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -62,6 +62,23 @@ config HW_CONSOLE depends on VT && !S390 && !UML default y +config VT_HW_CONSOLE_BINDING + bool "Support for binding and unbinding console drivers" + depends on HW_CONSOLE + default n + ---help--- + The virtual terminal is the device that interacts with the physical + terminal through console drivers. On these systems, at least one + console driver is loaded. In other configurations, additional console + drivers may be enabled, such as the framebuffer console. If more than + 1 console driver is enabled, setting this to 'y' will allow you to + select the console driver that will serve as the backend for the + virtual terminals. + + See for more + information. For framebuffer console users, please refer to + . + config SERIAL_NONSTANDARD bool "Non-standard serial port support" ---help--- diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 037d8a3f5882..714d95ff2f1e 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -2691,22 +2691,6 @@ int __init vty_init(void) static struct class *vtconsole_class; -static int con_is_graphics(const struct consw *csw, int first, int last) -{ - int i, retval = 0; - - for (i = first; i <= last; i++) { - struct vc_data *vc = vc_cons[i].d; - - if (vc && vc->vc_mode == KD_GRAPHICS) { - retval = 1; - break; - } - } - - return retval; -} - static int bind_con_driver(const struct consw *csw, int first, int last, int deflt) { @@ -2808,6 +2792,23 @@ err: return retval; }; +#ifdef CONFIG_VT_HW_CONSOLE_BINDING +static int con_is_graphics(const struct consw *csw, int first, int last) +{ + int i, retval = 0; + + for (i = first; i <= last; i++) { + struct vc_data *vc = vc_cons[i].d; + + if (vc && vc->vc_mode == KD_GRAPHICS) { + retval = 1; + break; + } + } + + return retval; +} + static int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) { @@ -2984,6 +2985,16 @@ static int vt_unbind(struct con_driver *con) err: return 0; } +#else +static inline int vt_bind(struct con_driver *con) +{ + return 0; +} +static inline int vt_unbind(struct con_driver *con) +{ + return 0; +} +#endif /* CONFIG_VT_HW_CONSOLE_BINDING */ static ssize_t store_bind(struct class_device *class_device, const char *buf, size_t count)