From: Kay Sievers Date: Mon, 20 Jul 2009 15:04:55 +0000 (+0100) Subject: vc: create vcs(a) devices for consoles X-Git-Tag: v2.6.31-rc4~27 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c46a7aec556ffdbdb7357db0b05904b176cb3375;p=pandora-kernel.git vc: create vcs(a) devices for consoles The buffer for the consoles are unconditionally allocated at con_init() time, which miss the creation of the vcs(a) devices. Since 2.6.30 (commit 4995f8ef9d3aac72745e12419d7fbaa8d01b1d81, 'vcs: hook sysfs devices into object lifetime instead of "binding"' to be exact) these devices are no longer created at open() and removed on close(), but controlled by the lifetime of the buffers. Reported-by: Gerardo Exequiel Pozzi Tested-by: Gerardo Exequiel Pozzi Cc: stable@kernel.org Signed-off-by: Kay Sievers Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c index d94d25c12aa8..c1791a63d99d 100644 --- a/drivers/char/vc_screen.c +++ b/drivers/char/vc_screen.c @@ -495,11 +495,15 @@ void vcs_remove_sysfs(int index) int __init vcs_init(void) { + unsigned int i; + if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) panic("unable to get major %d for vcs device", VCS_MAJOR); vc_class = class_create(THIS_MODULE, "vc"); device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); + for (i = 0; i < MIN_NR_CONSOLES; i++) + vcs_make_sysfs(i); return 0; }