diff options
author | Frans Pop <elendil@planet.nl> | 2008-07-24 00:31:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:39 -0400 |
commit | b604838ac6d233fd6bffc0e758a818133a01ff22 (patch) | |
tree | ac77c9696511f754f09bd435b12841216da745ee | |
parent | cfb4f5d1750e05f43902197713c50c29e7dfbc99 (diff) |
vfb: only enable if explicitly requested when compiled in
The Kconfig help for the vfb driver says:
Do NOT enable it for normal systems! To protect the innocent, it
has to be enabled explicitly at boot time using the kernel option
`video=vfb:'.
This change lets the code match the description.
Support for vfb:disable is kept for backwards compatibility; vfb:off works
because it is tested at a higher level.
Note: any undefined option (e.g. vfb:enable) will also enable this driver.
The relevant code has been unchanged since before the migration to
git (2.6.12).
This patch fixes bugzilla #9310 and was the root cause behind
http://lkml.org/lkml/2008/5/31/220.
Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Antonino A. Daplas <adaplas@gmail.com>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/vfb.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 072638a9528a..93fe08d6c78f 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c | |||
@@ -443,19 +443,29 @@ static int vfb_mmap(struct fb_info *info, | |||
443 | } | 443 | } |
444 | 444 | ||
445 | #ifndef MODULE | 445 | #ifndef MODULE |
446 | /* | ||
447 | * The virtual framebuffer driver is only enabled if explicitly | ||
448 | * requested by passing 'video=vfb:' (or any actual options). | ||
449 | */ | ||
446 | static int __init vfb_setup(char *options) | 450 | static int __init vfb_setup(char *options) |
447 | { | 451 | { |
448 | char *this_opt; | 452 | char *this_opt; |
449 | 453 | ||
454 | vfb_enable = 0; | ||
455 | |||
456 | if (!options) | ||
457 | return 1; | ||
458 | |||
450 | vfb_enable = 1; | 459 | vfb_enable = 1; |
451 | 460 | ||
452 | if (!options || !*options) | 461 | if (!*options) |
453 | return 1; | 462 | return 1; |
454 | 463 | ||
455 | while ((this_opt = strsep(&options, ",")) != NULL) { | 464 | while ((this_opt = strsep(&options, ",")) != NULL) { |
456 | if (!*this_opt) | 465 | if (!*this_opt) |
457 | continue; | 466 | continue; |
458 | if (!strncmp(this_opt, "disable", 7)) | 467 | /* Test disable for backwards compatibility */ |
468 | if (!strcmp(this_opt, "disable")) | ||
459 | vfb_enable = 0; | 469 | vfb_enable = 0; |
460 | } | 470 | } |
461 | return 1; | 471 | return 1; |