From: "Antonino A. Daplas" <adaplas@hotpop.com>

Fix fbcon's setup routine so usage is consistent with previous kernels. 
Ie: video=ofonly and video=xxxfb:off should work.

This is done by fb_get_options() returning a nonzero value if:

- 'off' option is present
- 'ofonly' is present but driver name is not 'offb'

All drivers will not proceed with their initialization if return value is
nonzero.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/video/68328fb.c               |    6 ++-
 25-akpm/drivers/video/acornfb.c               |    6 ++-
 25-akpm/drivers/video/amba-clcd.c             |    2 +
 25-akpm/drivers/video/amifb.c                 |    6 ++-
 25-akpm/drivers/video/asiliantfb.c            |    3 +
 25-akpm/drivers/video/aty/aty128fb.c          |   11 +++++-
 25-akpm/drivers/video/aty/atyfb_base.c        |   22 ++++++++-----
 25-akpm/drivers/video/aty/radeon_base.c       |    6 ++-
 25-akpm/drivers/video/bw2.c                   |    3 +
 25-akpm/drivers/video/cg14.c                  |    3 +
 25-akpm/drivers/video/cg3.c                   |    3 +
 25-akpm/drivers/video/cg6.c                   |    3 +
 25-akpm/drivers/video/chipsfb.c               |    3 +
 25-akpm/drivers/video/cirrusfb.c              |    6 ++-
 25-akpm/drivers/video/clps711xfb.c            |    3 +
 25-akpm/drivers/video/controlfb.c             |    5 ++
 25-akpm/drivers/video/cyber2000fb.c           |    6 ++-
 25-akpm/drivers/video/dnfb.c                  |    3 +
 25-akpm/drivers/video/epson1355fb.c           |    3 +
 25-akpm/drivers/video/fbmem.c                 |   44 +++++++++++++++-----------
 25-akpm/drivers/video/ffb.c                   |    3 +
 25-akpm/drivers/video/fm2fb.c                 |    6 ++-
 25-akpm/drivers/video/g364fb.c                |    3 +
 25-akpm/drivers/video/gbefb.c                 |    6 ++-
 25-akpm/drivers/video/hgafb.c                 |    3 +
 25-akpm/drivers/video/hitfb.c                 |    3 +
 25-akpm/drivers/video/hpfb.c                  |    3 +
 25-akpm/drivers/video/i810/i810_main.c        |    6 ++-
 25-akpm/drivers/video/igafb.c                 |    3 +
 25-akpm/drivers/video/imsttfb.c               |    7 +++-
 25-akpm/drivers/video/kyro/fbdev.c            |    6 ++-
 25-akpm/drivers/video/leo.c                   |    3 +
 25-akpm/drivers/video/macfb.c                 |    5 ++
 25-akpm/drivers/video/matrox/matroxfb_base.c  |    6 ++-
 25-akpm/drivers/video/matrox/matroxfb_crtc2.c |    3 +
 25-akpm/drivers/video/maxinefb.c              |    3 +
 25-akpm/drivers/video/neofb.c                 |    6 ++-
 25-akpm/drivers/video/offb.c                  |    5 ++
 25-akpm/drivers/video/p9100.c                 |    3 +
 25-akpm/drivers/video/platinumfb.c            |    6 ++-
 25-akpm/drivers/video/pm2fb.c                 |    6 ++-
 25-akpm/drivers/video/pmag-ba-fb.c            |    3 +
 25-akpm/drivers/video/pmagb-b-fb.c            |    3 +
 25-akpm/drivers/video/pvr2fb.c                |    6 ++-
 25-akpm/drivers/video/pxafb.c                 |    6 ++-
 25-akpm/drivers/video/q40fb.c                 |    3 +
 25-akpm/drivers/video/radeonfb.c              |    6 ++-
 25-akpm/drivers/video/riva/fbdev.c            |    6 ++-
 25-akpm/drivers/video/sa1100fb.c              |    3 +
 25-akpm/drivers/video/sgivwfb.c               |    6 ++-
 25-akpm/drivers/video/sis/sis_main.c          |    6 ++-
 25-akpm/drivers/video/skeletonfb.c            |    6 ++-
 25-akpm/drivers/video/sstfb.c                 |    6 ++-
 25-akpm/drivers/video/stifb.c                 |    6 ++-
 25-akpm/drivers/video/tcx.c                   |    3 +
 25-akpm/drivers/video/tdfxfb.c                |    7 +++-
 25-akpm/drivers/video/tgafb.c                 |    6 ++-
 25-akpm/drivers/video/tridentfb.c             |    6 ++-
 25-akpm/drivers/video/tx3912fb.c              |    5 ++
 25-akpm/drivers/video/valkyriefb.c            |    5 ++
 25-akpm/drivers/video/vesafb.c                |    5 ++
 25-akpm/drivers/video/vfb.c                   |    6 ++-
 25-akpm/drivers/video/vga16fb.c               |    8 +++-
 25-akpm/include/linux/fb.h                    |    2 -
 64 files changed, 298 insertions(+), 63 deletions(-)

diff -puN drivers/video/68328fb.c~fbcon-fix-fbcons-setup-routine drivers/video/68328fb.c
--- 25/drivers/video/68328fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/68328fb.c	Mon Sep 20 12:56:42 2004
@@ -440,7 +440,11 @@ int __init mc68x328fb_setup(char *option
 int __init mc68x328fb_init(void)
 {
 #ifndef MODULE
-	mc68x328fb_setup(fb_get_options("68328fb"));
+	char *option = NULL;
+
+	if (fb_get_options("68328fb", &option))
+		return -ENODEV;
+	mc68x328fb_setup(option);
 #endif
 	/*
 	 *  initialize the default mode from the LCD controller registers
diff -puN drivers/video/acornfb.c~fbcon-fix-fbcons-setup-routine drivers/video/acornfb.c
--- 25/drivers/video/acornfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/acornfb.c	Mon Sep 20 12:56:42 2004
@@ -1291,8 +1291,12 @@ acornfb_init(void)
 	unsigned long size;
 	u_int h_sync, v_sync;
 	int rc, i;
+	char *option = NULL;
+
+	if (fb_get_options("acornfb", &option))
+		return -ENODEV;
+	acornfb_setup(option);
 
-	acornfb_setup(fb_get_options("acornfb"));
 	acornfb_init_fbinfo();
 
 	current_par.dev = &acornfb_device;
diff -puN drivers/video/amba-clcd.c~fbcon-fix-fbcons-setup-routine drivers/video/amba-clcd.c
--- 25/drivers/video/amba-clcd.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/amba-clcd.c	Mon Sep 20 12:56:42 2004
@@ -496,6 +496,8 @@ static struct amba_driver clcd_driver = 
 
 int __init amba_clcdfb_init(void)
 {
+	if (fb_get_options("ambafb", NULL))
+		return -ENODEV;
 
 	return amba_driver_register(&clcd_driver);
 }
diff -puN drivers/video/amifb.c~fbcon-fix-fbcons-setup-routine drivers/video/amifb.c
--- 25/drivers/video/amifb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/amifb.c	Mon Sep 20 12:56:42 2004
@@ -2258,7 +2258,11 @@ int __init amifb_init(void)
 	u_int defmode;
 
 #ifndef MODULE
-	amifb_setup(fb_get_options("amifb"));
+	char *option = NULL;
+
+	if (fb_get_options("amifb", &option))
+		return -ENODEV;
+	amifb_setup(option);
 #endif
 	if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_VIDEO))
 		return -ENXIO;
diff -puN drivers/video/asiliantfb.c~fbcon-fix-fbcons-setup-routine drivers/video/asiliantfb.c
--- 25/drivers/video/asiliantfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/asiliantfb.c	Mon Sep 20 12:56:42 2004
@@ -609,6 +609,9 @@ static struct pci_driver asiliantfb_driv
 
 int __init asiliantfb_init(void)
 {
+	if (fb_get_options("asiliantfb", NULL))
+		return -ENODEV;
+
 	return pci_module_init(&asiliantfb_driver);
 }
 
diff -puN drivers/video/aty/aty128fb.c~fbcon-fix-fbcons-setup-routine drivers/video/aty/aty128fb.c
--- 25/drivers/video/aty/aty128fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/aty/aty128fb.c	Mon Sep 20 12:56:42 2004
@@ -2439,6 +2439,14 @@ static int aty128_pci_resume(struct pci_
 
 int __init aty128fb_init(void)
 {
+#ifndef MODULE
+	char *option = NULL;
+
+	if (fb_get_options("aty128fb", &option))
+		return -ENODEV;
+	aty128fb_setup(option);
+#endif
+
 	return pci_module_init(&aty128fb_driver);
 }
 
@@ -2447,8 +2455,9 @@ static void __exit aty128fb_exit(void)
 	pci_unregister_driver(&aty128fb_driver);
 }
 
-#ifdef MODULE
 module_init(aty128fb_init);
+
+#ifdef MODULE
 module_exit(aty128fb_exit);
 
 MODULE_AUTHOR("(c)1999-2003 Brad Douglas <brad@neruo.com>");
diff -puN drivers/video/aty/atyfb_base.c~fbcon-fix-fbcons-setup-routine drivers/video/aty/atyfb_base.c
--- 25/drivers/video/aty/atyfb_base.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/aty/atyfb_base.c	Mon Sep 20 12:56:42 2004
@@ -1902,7 +1902,7 @@ static int __init aty_init(struct fb_inf
 	return 1;
 }
 
-int __init atyfb_init(void)
+int __init atyfb_do_init(void)
 {
 #if defined(CONFIG_PCI)
 	unsigned long addr, res_start, res_size;
@@ -1920,13 +1920,6 @@ int __init atyfb_init(void)
 #else
 	u16 tmp;
 #endif
-#endif
-
-#ifndef MODULE
-	atyfb_setup(fb_get_options("atyfb"));
-#endif
-
-#if defined(CONFIG_PCI)
 
 #ifdef __sparc__
 	/* Do not attach when we have a serial console. */
@@ -2386,6 +2379,19 @@ int __init atyfb_init(void)
 	return 0;
 }
 
+int __init atyfb_init(void)
+{
+#ifndef MODULE
+	char *option = NULL;
+
+	if (fb_get_options("atyfb", &option))
+		return -ENODEV;
+	atyfb_setup(option);
+#endif
+	return atyfb_do_init();
+}
+
+
 #ifndef MODULE
 int __init atyfb_setup(char *options)
 {
diff -puN drivers/video/aty/radeon_base.c~fbcon-fix-fbcons-setup-routine drivers/video/aty/radeon_base.c
--- 25/drivers/video/aty/radeon_base.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/aty/radeon_base.c	Mon Sep 20 12:56:42 2004
@@ -2373,7 +2373,11 @@ int __init radeonfb_setup (char *options
 int __init radeonfb_init (void)
 {
 #ifndef MODULE
-	radeonfb_setup(fb_get_options("radeonfb"));
+	char *option = NULL;
+
+	if (fb_get_options("radeonfb", &option))
+		return -ENODEV;
+	radeonfb_setup(option);
 #endif
 	return pci_module_init (&radeonfb_driver);
 }
diff -puN drivers/video/bw2.c~fbcon-fix-fbcons-setup-routine drivers/video/bw2.c
--- 25/drivers/video/bw2.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/bw2.c	Mon Sep 20 12:56:42 2004
@@ -386,6 +386,9 @@ int __init bw2_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("bw2fb", &option))
+		return -ENODEV;
+
 #ifdef CONFIG_SUN4
 	bw2_init_one(NULL);
 #endif
diff -puN drivers/video/cg14.c~fbcon-fix-fbcons-setup-routine drivers/video/cg14.c
--- 25/drivers/video/cg14.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/cg14.c	Mon Sep 20 12:56:42 2004
@@ -584,6 +584,9 @@ int __init cg14_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("cg14fb", NULL))
+		return -ENODEV;
+
 #ifdef CONFIG_SPARC32
 	{
 		int root, node;
diff -puN drivers/video/cg3.c~fbcon-fix-fbcons-setup-routine drivers/video/cg3.c
--- 25/drivers/video/cg3.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/cg3.c	Mon Sep 20 12:56:42 2004
@@ -444,6 +444,9 @@ int __init cg3_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("cg3fb", NULL))
+		return -ENODEV;
+
 	for_all_sbusdev(sdev, sbus) {
 		if (!strcmp(sdev->prom_name, "cgthree") ||
 		    !strcmp(sdev->prom_name, "cgRDI"))
diff -puN drivers/video/cg6.c~fbcon-fix-fbcons-setup-routine drivers/video/cg6.c
--- 25/drivers/video/cg6.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/cg6.c	Mon Sep 20 12:56:42 2004
@@ -760,6 +760,9 @@ int __init cg6_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("cg6fb", NULL))
+		return -ENODEV;
+
 	for_all_sbusdev(sdev, sbus) {
 		if (!strcmp(sdev->prom_name, "cgsix") ||
 		    !strcmp(sdev->prom_name, "cgthree+"))
diff -puN drivers/video/chipsfb.c~fbcon-fix-fbcons-setup-routine drivers/video/chipsfb.c
--- 25/drivers/video/chipsfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/chipsfb.c	Mon Sep 20 12:56:42 2004
@@ -462,6 +462,9 @@ static struct pci_driver chipsfb_driver 
 
 int __init chips_init(void)
 {
+	if (fb_get_options("chipsfb", NULL))
+		return -ENODEV;
+
 	return pci_module_init(&chipsfb_driver);
 }
 
diff -puN drivers/video/cirrusfb.c~fbcon-fix-fbcons-setup-routine drivers/video/cirrusfb.c
--- 25/drivers/video/cirrusfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/cirrusfb.c	Mon Sep 20 12:56:42 2004
@@ -2607,7 +2607,11 @@ int __init cirrusfb_init(void)
 	int error = 0;
 
 #ifndef MODULE
-	cirrusfb_setup(fb_get_options("cirrusfb"));
+	char *option = NULL;
+
+	if (fb_get_options("cirrusfb", &option))
+		return -ENODEV;
+	cirrusfb_setup(option);
 #endif
 
 #ifdef CONFIG_ZORRO
diff -puN drivers/video/clps711xfb.c~fbcon-fix-fbcons-setup-routine drivers/video/clps711xfb.c
--- 25/drivers/video/clps711xfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/clps711xfb.c	Mon Sep 20 12:56:42 2004
@@ -364,6 +364,9 @@ int __init clps711xfb_init(void)
 {
 	int err = -ENOMEM;
 
+	if (fb_get_options("clps711xfb", NULL))
+		return -ENODEV;
+
 	cfb = kmalloc(sizeof(*cfb), GFP_KERNEL);
 	if (!cfb)
 		goto out;
diff -puN drivers/video/controlfb.c~fbcon-fix-fbcons-setup-routine drivers/video/controlfb.c
--- 25/drivers/video/controlfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/controlfb.c	Mon Sep 20 12:56:42 2004
@@ -556,8 +556,11 @@ static void control_set_hardware(struct 
 int __init control_init(void)
 {
 	struct device_node *dp;
+	char *option = NULL;
 
-	control_setup(fb_get_options("controlfb"));
+	if (fb_get_options("controlfb", &option))
+		return -ENODEV;
+	control_setup(option);
 
 	dp = find_devices("control");
 	if (dp != 0 && !control_of_init(dp))
diff -puN drivers/video/cyber2000fb.c~fbcon-fix-fbcons-setup-routine drivers/video/cyber2000fb.c
--- 25/drivers/video/cyber2000fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/cyber2000fb.c	Mon Sep 20 12:56:42 2004
@@ -1720,7 +1720,11 @@ int __init cyber2000fb_init(void)
 	int ret = -1, err;
 
 #ifndef MODULE
-	cyber2000fb_setup(fb_get_options("cyber200fb"));
+	char *option = NULL;
+
+	if (fb_get_options("cyber2000fb", NULL))
+		return -ENODEV;
+	cyber2000fb_setup(option);
 #endif
 
 #ifdef CONFIG_ARCH_SHARK
diff -puN drivers/video/dnfb.c~fbcon-fix-fbcons-setup-routine drivers/video/dnfb.c
--- 25/drivers/video/dnfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/dnfb.c	Mon Sep 20 12:56:42 2004
@@ -284,6 +284,9 @@ int __init dnfb_init(void)
 {
 	int ret;
 
+	if (fb_get_options("dnfb", NULL))
+		return -ENODEV;
+
 	ret = driver_register(&dnfb_driver);
 
 	if (!ret) {
diff -puN drivers/video/epson1355fb.c~fbcon-fix-fbcons-setup-routine drivers/video/epson1355fb.c
--- 25/drivers/video/epson1355fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/epson1355fb.c	Mon Sep 20 12:56:42 2004
@@ -740,6 +740,9 @@ int __init epson1355fb_init(void)
 {
 	int ret = 0;
 
+	if (fb_get_options("epson1355fb", NULL))
+		return -ENODEV;
+
 	ret = driver_register(&epson1355fb_driver);
 	if (!ret) {
 		ret = platform_device_register(&epson1355fb_device);
diff -puN drivers/video/fbmem.c~fbcon-fix-fbcons-setup-routine drivers/video/fbmem.c
--- 25/drivers/video/fbmem.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/fbmem.c	Mon Sep 20 12:56:42 2004
@@ -1296,6 +1296,7 @@ module_init(fbmem_init);
 
 #define NR_FB_DRIVERS 64
 static char *video_options[NR_FB_DRIVERS];
+static int ofonly;
 
 /**
  * fb_get_options - get kernel boot parameters
@@ -1305,30 +1306,35 @@ static char *video_options[NR_FB_DRIVERS
  *
  * NOTE: Needed to maintain backwards compatibility
  */
-char* fb_get_options(char *name)
+int fb_get_options(char *name, char **option)
 {
-	char *option = NULL;
-	char *opt;
-	int opt_len;
+	char *opt, *options = NULL;
+	int opt_len, retval = 0;
 	int name_len = strlen(name), i;
 
-	if (!name_len)
-		return option;
+	if (name_len && ofonly && strncmp(name, "offb", 4))
+		retval = 1;
 
-	for (i = 0; i < NR_FB_DRIVERS; i++) {
-		if (video_options[i] == NULL)
-			continue;
-		opt_len = strlen(video_options[i]);
-		if (!opt_len)
-			continue;
-		opt = video_options[i];
-		if (!strncmp(name, opt, name_len) &&
-		    opt[name_len] == ':') {
-			option = opt + name_len + 1;
-			break;
+	if (name_len && !retval) {
+		for (i = 0; i < NR_FB_DRIVERS; i++) {
+			if (video_options[i] == NULL)
+				continue;
+			opt_len = strlen(video_options[i]);
+			if (!opt_len)
+				continue;
+			opt = video_options[i];
+			if (!strncmp(name, opt, name_len) &&
+			    opt[name_len] == ':')
+				options = opt + name_len + 1;
 		}
 	}
-	return option;
+	if (options && !strncmp(options, "off", 3))
+		retval = 1;
+
+	if (option)
+		*option = options;
+
+	return retval;
 }
 
 /**
@@ -1353,6 +1359,8 @@ int __init video_setup(char *options)
 		return 0;
 
 	for (i = 0; i < NR_FB_DRIVERS; i++) {
+		if (!strncmp(options, "ofonly", 6))
+			ofonly = 1;
 		if (video_options[i] == NULL) {
 			video_options[i] = options;
 			break;
diff -puN drivers/video/ffb.c~fbcon-fix-fbcons-setup-routine drivers/video/ffb.c
--- 25/drivers/video/ffb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/ffb.c	Mon Sep 20 12:56:42 2004
@@ -1049,6 +1049,9 @@ int __init ffb_init(void)
 {
 	int root;
 
+	if (fb_get_options("ffb", NULL))
+		return -ENODEV;
+
 	ffb_scan_siblings(prom_root_node);
 
 	root = prom_getchild(prom_root_node);
diff -puN drivers/video/fm2fb.c~fbcon-fix-fbcons-setup-routine drivers/video/fm2fb.c
--- 25/drivers/video/fm2fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/fm2fb.c	Mon Sep 20 12:56:42 2004
@@ -296,7 +296,11 @@ int __init fm2fb_setup(char *options);
 
 int __init fm2fb_init(void)
 {
-	fm2fb_setup(fb_get_options("fb2fb"));
+	char *option = NULL;
+
+	if (fb_get_options("fm2fb", &option))
+		return -ENODEV;
+	fm2fb_setup(option);
 	return zorro_register_driver(&fm2fb_driver);
 }
 
diff -puN drivers/video/g364fb.c~fbcon-fix-fbcons-setup-routine drivers/video/g364fb.c
--- 25/drivers/video/g364fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/g364fb.c	Mon Sep 20 12:56:42 2004
@@ -202,6 +202,9 @@ int __init g364fb_init(void)
 	    (volatile unsigned int *) CURS_PAL_REG;
 	int mem, i, j;
 
+	if (fb_get_options("g364fb", NULL))
+		return -ENODEV;
+
 	/* TBD: G364 detection */
 
 	/* get the resolution set by ARC console */
diff -puN drivers/video/gbefb.c~fbcon-fix-fbcons-setup-routine drivers/video/gbefb.c
--- 25/drivers/video/gbefb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/gbefb.c	Mon Sep 20 12:56:42 2004
@@ -1084,7 +1084,11 @@ int __init gbefb_init(void)
 	int i, ret = 0;
 
 #ifndef MODULE
-	gbefb_setup(fb_get_options("gbefb"));
+	char *option = NULL;
+
+	if (fb_get_options("gbefb", &option))
+		return -ENODEV;
+	gbefb_setup(options);
 #endif
 
 	if (!request_mem_region(GBE_BASE, sizeof(struct sgi_gbe), "GBE")) {
diff -puN drivers/video/hgafb.c~fbcon-fix-fbcons-setup-routine drivers/video/hgafb.c
--- 25/drivers/video/hgafb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/hgafb.c	Mon Sep 20 12:56:42 2004
@@ -547,6 +547,9 @@ static struct fb_ops hgafb_ops = {
 
 int __init hgafb_init(void)
 {
+	if (fb_get_options("hgafb", NULL))
+		return -ENODEV;
+
 	if (! hga_card_detect()) {
 		printk(KERN_INFO "hgafb: HGA card not detected.\n");
 		return -EINVAL;
diff -puN drivers/video/hitfb.c~fbcon-fix-fbcons-setup-routine drivers/video/hitfb.c
--- 25/drivers/video/hitfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/hitfb.c	Mon Sep 20 12:56:42 2004
@@ -270,6 +270,9 @@ int __init hitfb_init(void)
 	unsigned short lcdclor, ldr3, ldvndr;
 	int size;
 
+	if (fb_get_options("hitfb", NULL))
+		return -ENODEV;
+
 	hitfb_fix.smem_start = CONFIG_HD64461_IOBASE + 0x02000000;
 	hitfb_fix.smem_len = (MACH_HP690) ? 1024 * 1024 : 512 * 1024;
 
diff -puN drivers/video/hpfb.c~fbcon-fix-fbcons-setup-routine drivers/video/hpfb.c
--- 25/drivers/video/hpfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/hpfb.c	Mon Sep 20 12:56:42 2004
@@ -115,6 +115,9 @@ int __init hpfb_init_one(unsigned long b
 {
 	unsigned long fboff;
 
+	if (fb_get_options("hpfb", NULL))
+		return -ENODEV;
+
 	fboff = (in_8(base + TOPCAT_FBOMSB) << 8) | in_8(base + TOPCAT_FBOLSB);
 
 	hpfb_fix.smem_start = 0xf0000000 | (in_8(base + fboff) << 16);
diff -puN drivers/video/i810/i810_main.c~fbcon-fix-fbcons-setup-routine drivers/video/i810/i810_main.c
--- 25/drivers/video/i810/i810_main.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/i810/i810_main.c	Mon Sep 20 12:56:42 2004
@@ -1989,7 +1989,11 @@ static void __exit i810fb_remove_pci(str
 #ifndef MODULE
 int __init i810fb_init(void)
 {
-	i810fb_setup(fb_get_options("i810fb"));
+	char *option = NULL;
+
+	if (fb_get_options("i810fb", &option))
+		return -ENODEV;
+	i810fb_setup(option);
 
 	if (agp_intel_init()) {
 		printk("i810fb_init: cannot initialize intel agpgart\n");
diff -puN drivers/video/igafb.c~fbcon-fix-fbcons-setup-routine drivers/video/igafb.c
--- 25/drivers/video/igafb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/igafb.c	Mon Sep 20 12:56:42 2004
@@ -381,6 +381,9 @@ int __init igafb_init(void)
 	unsigned long addr;
 	int size, iga2000 = 0;
 
+	if (fb_get_options("igafb", NULL))
+		return -ENODEV;
+
         /* Do not attach when we have a serial console. */
         if (!con_is_present())
                 return -ENXIO;
diff -puN drivers/video/imsttfb.c~fbcon-fix-fbcons-setup-routine drivers/video/imsttfb.c
--- 25/drivers/video/imsttfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/imsttfb.c	Mon Sep 20 12:56:42 2004
@@ -1603,7 +1603,12 @@ imsttfb_setup(char *options)
 int __init imsttfb_init(void)
 {
 #ifndef MODULE
-	imsttfb_setup(fb_get_options("imsttfb"));
+	char *option = NULL;
+
+	if (fb_get_options("imsttfb", &option))
+		return -ENODEV;
+
+	imsttfb_setup(option);
 #endif
 	return pci_module_init(&imsttfb_pci_driver);
 }
diff -puN drivers/video/kyro/fbdev.c~fbcon-fix-fbcons-setup-routine drivers/video/kyro/fbdev.c
--- 25/drivers/video/kyro/fbdev.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/kyro/fbdev.c	Mon Sep 20 12:56:42 2004
@@ -788,7 +788,11 @@ static void __devexit kyrofb_remove(stru
 int __init kyrofb_init(void)
 {
 #ifndef MODULE
-	kyrofb_setup(fb_get_options("kyrofb"));
+	char *option = NULL;
+
+	if (fb_get_options("kyrofb", &option))
+		return -ENODEV;
+	kyrofb_setup(option);
 #endif
 	return pci_module_init(&kyrofb_pci_driver);
 }
diff -puN drivers/video/leo.c~fbcon-fix-fbcons-setup-routine drivers/video/leo.c
--- 25/drivers/video/leo.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/leo.c	Mon Sep 20 12:56:42 2004
@@ -626,6 +626,9 @@ int __init leo_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("leofb", NULL))
+		return -ENODEV;
+
 	for_all_sbusdev(sdev, sbus) {
 		if (!strcmp(sdev->prom_name, "leo"))
 			leo_init_one(sdev);
diff -puN drivers/video/macfb.c~fbcon-fix-fbcons-setup-routine drivers/video/macfb.c
--- 25/drivers/video/macfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/macfb.c	Mon Sep 20 12:56:42 2004
@@ -614,8 +614,11 @@ void __init macfb_init(void)
 {
 	int video_cmap_len, video_is_nubus = 0;
 	struct nubus_dev* ndev = NULL;
+	char *option = NULL;
 
-	macfb_setup(fb_get_options("macfb"));
+	if (fb_get_options("macfb", &option))
+		return -ENODEV;
+	macfb_setup(option);
 
 	if (!MACH_IS_MAC) 
 		return;
diff -puN drivers/video/matrox/matroxfb_base.c~fbcon-fix-fbcons-setup-routine drivers/video/matrox/matroxfb_base.c
--- 25/drivers/video/matrox/matroxfb_base.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/matrox/matroxfb_base.c	Mon Sep 20 12:56:42 2004
@@ -2415,9 +2415,13 @@ static int __initdata initialized = 0;
 
 int __init matroxfb_init(void)
 {
+	char *option = NULL;
+
 	DBG(__FUNCTION__)
 
-	matroxfb_setup(fb_get_options("matroxfb"));
+	if (fb_get_options("matroxfb", &option))
+		return -ENODEV;
+	matroxfb_setup(option);
 
 	if (disabled)
 		return -ENXIO;
diff -puN drivers/video/matrox/matroxfb_crtc2.c~fbcon-fix-fbcons-setup-routine drivers/video/matrox/matroxfb_crtc2.c
--- 25/drivers/video/matrox/matroxfb_crtc2.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/matrox/matroxfb_crtc2.c	Mon Sep 20 12:56:42 2004
@@ -721,6 +721,9 @@ static struct matroxfb_driver crtc2 = {
 		.remove =	matroxfb_crtc2_remove };
 
 static int matroxfb_crtc2_init(void) {
+	if (fb_get_options("matrox_crtc2fb", NULL))
+		return -ENODEV;
+
 	matroxfb_register_driver(&crtc2);
 	return 0;
 }
diff -puN drivers/video/maxinefb.c~fbcon-fix-fbcons-setup-routine drivers/video/maxinefb.c
--- 25/drivers/video/maxinefb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/maxinefb.c	Mon Sep 20 12:56:42 2004
@@ -126,6 +126,9 @@ int __init maxinefb_init(void)
 	unsigned long fb_start;
 	int i;
 
+	if (fb_get_options("maxinefb", NULL))
+		return -ENODEV;
+
 	/* Validate we're on the proper machine type */
 	if (mips_machtype != MACH_DS5000_XX) {
 		return -EINVAL;
diff -puN drivers/video/neofb.c~fbcon-fix-fbcons-setup-routine drivers/video/neofb.c
--- 25/drivers/video/neofb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/neofb.c	Mon Sep 20 12:56:42 2004
@@ -2268,7 +2268,11 @@ int __init neofb_setup(char *options)
 int __init neofb_init(void)
 {
 #ifndef MODULE
-	neofb_setup(fb_get_options("neofb"));
+	char *option = NULL;
+
+	if (fb_get_options("neofb", &option))
+		return -ENODEV;
+	neofb_setup(option);
 #endif
 	return pci_register_driver(&neofb_driver);
 }
diff -puN drivers/video/offb.c~fbcon-fix-fbcons-setup-routine drivers/video/offb.c
--- 25/drivers/video/offb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/offb.c	Mon Sep 20 12:56:42 2004
@@ -247,10 +247,15 @@ int __init offb_init(void)
 {
 	struct device_node *dp;
 	unsigned int dpy;
+	char *option = NULL;
 #if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32)
 	struct device_node *displays = find_type_devices("display");
 	struct device_node *macos_display = NULL;
+#endif
+	if (fb_get_options("offb", NULL))
+		return -ENODEV;
 
+#if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32)
 	/* If we're booted from BootX... */
 	if (prom_num_displays == 0 && boot_infos != 0) {
 		unsigned long addr =
diff -puN drivers/video/p9100.c~fbcon-fix-fbcons-setup-routine drivers/video/p9100.c
--- 25/drivers/video/p9100.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/p9100.c	Mon Sep 20 12:56:42 2004
@@ -340,6 +340,9 @@ int __init p9100_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("p9100fb", NULL))
+		return -ENODEV;
+
 	for_all_sbusdev(sdev, sbus) {
 		if (!strcmp(sdev->prom_name, "p9100"))
 			p9100_init_one(sdev);
diff -puN drivers/video/platinumfb.c~fbcon-fix-fbcons-setup-routine drivers/video/platinumfb.c
--- 25/drivers/video/platinumfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/platinumfb.c	Mon Sep 20 12:56:42 2004
@@ -668,7 +668,11 @@ static struct of_platform_driver platinu
 int __init platinumfb_init(void)
 {
 #ifndef MODULE
-	platinumfb_setup(fb_get_options("platinumfb"));
+	char *option = NULL;
+
+	if (fb_get_options("platinumfb", &option))
+		return -ENODEV;
+	platinumfb_setup(option);
 #endif
 	of_register_driver(&platinum_driver);
 
diff -puN drivers/video/pm2fb.c~fbcon-fix-fbcons-setup-routine drivers/video/pm2fb.c
--- 25/drivers/video/pm2fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/pm2fb.c	Mon Sep 20 12:56:42 2004
@@ -1220,7 +1220,11 @@ int __init pm2fb_setup(char *options);
 int __init pm2fb_init(void)
 {
 #ifndef MODULE
-	pm2fb_setup(fb_get_options("pm2fb"));
+	char *option = NULL;
+
+	if (fb_get_options("pm2fb", &option))
+		return -ENODEV;
+	pm2fb_setup(option);
 #endif
 
 	return pci_module_init(&pm2fb_driver);
diff -puN drivers/video/pmag-ba-fb.c~fbcon-fix-fbcons-setup-routine drivers/video/pmag-ba-fb.c
--- 25/drivers/video/pmag-ba-fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/pmag-ba-fb.c	Mon Sep 20 12:56:42 2004
@@ -160,6 +160,9 @@ int __init pmagbafb_init(void)
 	int sid;
 	int found = 0;
 
+	if (fb_get_options("pmagbafb", NULL))
+		return -ENODEV;
+
 	if (TURBOCHANNEL) {
 		while ((sid = search_tc_card("PMAG-BA")) >= 0) {
 			found = 1;
diff -puN drivers/video/pmagb-b-fb.c~fbcon-fix-fbcons-setup-routine drivers/video/pmagb-b-fb.c
--- 25/drivers/video/pmagb-b-fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/pmagb-b-fb.c	Mon Sep 20 12:56:42 2004
@@ -163,6 +163,9 @@ int __init pmagbbfb_init(void)
 	int sid;
 	int found = 0;
 
+	if (fb_get_options("pmagbbfb", NULL))
+		return -ENODEV;
+
 	if (TURBOCHANNEL) {
 		while ((sid = search_tc_card("PMAGB-BA")) >= 0) {
 			found = 1;
diff -puN drivers/video/pvr2fb.c~fbcon-fix-fbcons-setup-routine drivers/video/pvr2fb.c
--- 25/drivers/video/pvr2fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/pvr2fb.c	Mon Sep 20 12:56:42 2004
@@ -1058,7 +1058,11 @@ int __init pvr2fb_init(void)
 	int size;
 
 #ifndef MODULE
-	pvr2fb_setup(fb_get_options("pvr2fb"));
+	char *option = NULL;
+
+	if (fb_get_options("pvr2fb", &option))
+		return -ENODEV;
+	pvr2fb_setup(option);
 #endif
 	size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32);
 
diff -puN drivers/video/pxafb.c~fbcon-fix-fbcons-setup-routine drivers/video/pxafb.c
--- 25/drivers/video/pxafb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/pxafb.c	Mon Sep 20 12:56:42 2004
@@ -1377,7 +1377,11 @@ MODULE_PARM_DESC(options, "LCD parameter
 int __devinit pxafb_init(void)
 {
 #ifndef MODULE
-	pxafb_setup(fb_get_options("pxafb"));
+	char *option = NULL;
+
+	if (fb_get_options("pxafb", &option))
+		return -ENODEV;
+	pxafb_setup(option);
 #endif
 	return driver_register(&pxafb_driver);
 }
diff -puN drivers/video/q40fb.c~fbcon-fix-fbcons-setup-routine drivers/video/q40fb.c
--- 25/drivers/video/q40fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/q40fb.c	Mon Sep 20 12:56:42 2004
@@ -143,6 +143,9 @@ int __init q40fb_init(void)
 {
 	int ret = 0;
 
+	if (fb_get_options("q40fb", NULL))
+		return -ENODEV;
+
 	ret = driver_register(&q40fb_driver);
 
 	if (!ret) {
diff -puN drivers/video/radeonfb.c~fbcon-fix-fbcons-setup-routine drivers/video/radeonfb.c
--- 25/drivers/video/radeonfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/radeonfb.c	Mon Sep 20 12:56:42 2004
@@ -3137,7 +3137,11 @@ int __init radeonfb_old_setup (char *opt
 int __init radeonfb_old_init (void)
 {
 #ifndef MODULE
-	radeonfb_old_setup(fb_get_options("radeonfb_old"));
+	char *option = NULL;
+
+	if (fb_get_options("radeonfb_old", &option))
+		return -ENODEV;
+	radeonfb_old_setup(option);
 #endif
 	return pci_module_init (&radeonfb_driver);
 }
diff -puN drivers/video/riva/fbdev.c~fbcon-fix-fbcons-setup-routine drivers/video/riva/fbdev.c
--- 25/drivers/video/riva/fbdev.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/riva/fbdev.c	Mon Sep 20 12:56:42 2004
@@ -2141,7 +2141,11 @@ static struct pci_driver rivafb_driver =
 int __devinit rivafb_init(void)
 {
 #ifndef MODULE
-	rivafb_setup(fb_get_options("rivafb"));
+	char *option = NULL;
+
+	if (fb_get_options("rivafb", &option))
+		return -ENODEV;
+	rivafb_setup(option);
 #endif
 	if (pci_register_driver(&rivafb_driver) > 0)
 		return 0;
diff -puN drivers/video/sa1100fb.c~fbcon-fix-fbcons-setup-routine drivers/video/sa1100fb.c
--- 25/drivers/video/sa1100fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/sa1100fb.c	Mon Sep 20 12:56:42 2004
@@ -1804,6 +1804,9 @@ static struct device_driver sa1100fb_dri
 
 int __init sa1100fb_init(void)
 {
+	if (fb_get_options("sa1100fb", NULL))
+		return -ENODEV;
+
 	return driver_register(&sa1100fb_driver);
 }
 
diff -puN drivers/video/sgivwfb.c~fbcon-fix-fbcons-setup-routine drivers/video/sgivwfb.c
--- 25/drivers/video/sgivwfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/sgivwfb.c	Mon Sep 20 12:56:42 2004
@@ -870,7 +870,11 @@ int __init sgivwfb_init(void)
 	int ret;
 
 #ifndef MODULE
-	sgivwfb_setup(fb_get_options("sgivwfb"));
+	char *option = NULL;
+
+	if (fb_get_options("sgivwfb", &option))
+		return -ENODEV;
+	sgivwfb_setup(option);
 #endif
 	ret = driver_register(&sgivwfb_driver);
 	if (!ret) {
diff -puN drivers/video/sis/sis_main.c~fbcon-fix-fbcons-setup-routine drivers/video/sis/sis_main.c
--- 25/drivers/video/sis/sis_main.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/sis/sis_main.c	Mon Sep 20 12:56:42 2004
@@ -5720,7 +5720,11 @@ int __init sisfb_init(void)
 {
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
 #ifndef MODULE
-	sisfb_setup(fb_get_options("sisfb"));
+	char *option = NULL;
+
+	if (fb_get_options("sisfb", &option))
+		return -ENODEV;
+	sisfb_setup(option);
 #endif
 #endif
 	return(pci_module_init(&sisfb_driver));
diff -puN drivers/video/skeletonfb.c~fbcon-fix-fbcons-setup-routine drivers/video/skeletonfb.c
--- 25/drivers/video/skeletonfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/skeletonfb.c	Mon Sep 20 12:56:42 2004
@@ -586,7 +586,11 @@ static void __exit xxxfb_cleanup(void)
      *  For kernel boot options (in 'video=xxxfb:<options>' format)
      */
 #ifndef MODULE
-    xxxfb_setup(fb_get_options("xxxfb"));
+    char *option = NULL;
+
+    if (fb_get_options("xxxfb", &option))
+	    return -ENODEV;
+    xxxfb_setup(option);
 #endif
 
     /*
diff -puN drivers/video/sstfb.c~fbcon-fix-fbcons-setup-routine drivers/video/sstfb.c
--- 25/drivers/video/sstfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/sstfb.c	Mon Sep 20 12:56:42 2004
@@ -1572,7 +1572,11 @@ static struct pci_driver sstfb_driver = 
 int __devinit sstfb_init(void)
 {
 #ifndef MODULE
-	sstfb_setup(fb_get_options("sstfb"));
+	char *option = NULL;
+
+	if (fb_get_options("sstfb", &option))
+		return -ENODEV;
+	sstfb_setup(option);
 #endif
 	return pci_module_init(&sstfb_driver);
 }
diff -puN drivers/video/stifb.c~fbcon-fix-fbcons-setup-routine drivers/video/stifb.c
--- 25/drivers/video/stifb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/stifb.c	Mon Sep 20 12:56:42 2004
@@ -1386,7 +1386,11 @@ stifb_init(void)
 	int i;
 	
 #ifndef MODULE
-	stifb_setup(fb_get_options("stifb"));
+	char *option = NULL;
+
+	if (fb_get_options("stifb", &option))
+		return -ENODEV;
+	stifb_setup(option);
 #endif
 	if (stifb_disabled) {
 		printk(KERN_INFO "stifb: disabled by \"stifb=off\" kernel parameter\n");
diff -puN drivers/video/tcx.c~fbcon-fix-fbcons-setup-routine drivers/video/tcx.c
--- 25/drivers/video/tcx.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/tcx.c	Mon Sep 20 12:56:42 2004
@@ -468,6 +468,9 @@ int __init tcx_init(void)
 	struct sbus_bus *sbus;
 	struct sbus_dev *sdev;
 
+	if (fb_get_options("tcxfb", NULL))
+		return -ENODEV;
+
 	for_all_sbusdev(sdev, sbus) {
 		if (!strcmp(sdev->prom_name, "tcx"))
 			tcx_init_one(sdev);
diff -puN drivers/video/tdfxfb.c~fbcon-fix-fbcons-setup-routine drivers/video/tdfxfb.c
--- 25/drivers/video/tdfxfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/tdfxfb.c	Mon Sep 20 12:56:42 2004
@@ -1363,7 +1363,12 @@ static void __devexit tdfxfb_remove(stru
 int __init tdfxfb_init(void)
 {
 #ifndef MODULE
-	tdfxfb_setup(fb_get_options("tdfxfb"));
+	char *option = NULL;
+
+	if (fb_get_options("tdfxfb", &option))
+		return -ENODEV;
+
+	tdfxfb_setup(option);
 #endif
         return pci_module_init(&tdfxfb_driver);
 }
diff -puN drivers/video/tgafb.c~fbcon-fix-fbcons-setup-routine drivers/video/tgafb.c
--- 25/drivers/video/tgafb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/tgafb.c	Mon Sep 20 12:56:42 2004
@@ -1527,7 +1527,11 @@ int __init
 tgafb_init(void)
 {
 #ifndef MODULE
-	tgafb_setup(fb_get_options("tgafb"));
+	char *option = NULL;
+
+	if (fb_get_options("tgafb", &option))
+		return -ENODEV;
+	tgafb_setup(option);
 #endif
 	return pci_module_init(&tgafb_driver);
 }
diff -puN drivers/video/tridentfb.c~fbcon-fix-fbcons-setup-routine drivers/video/tridentfb.c
--- 25/drivers/video/tridentfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/tridentfb.c	Mon Sep 20 12:56:42 2004
@@ -1223,7 +1223,11 @@ int tridentfb_setup(char *options);
 int __init tridentfb_init(void)
 {
 #ifndef MODULE
-	tridentfb_setup(fb_get_options("tridentfb"));
+	char *option = NULL;
+
+	if (fb_get_options("tridentfb", &option))
+		return -ENODEV;
+	tridentfb_setup(option);
 #endif
 	output("Trident framebuffer %s initializing\n", VERSION);
 	return pci_module_init(&tridentfb_pci_driver);
diff -puN drivers/video/tx3912fb.c~fbcon-fix-fbcons-setup-routine drivers/video/tx3912fb.c
--- 25/drivers/video/tx3912fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/tx3912fb.c	Mon Sep 20 12:56:42 2004
@@ -217,8 +217,11 @@ int __init tx3912fb_init(void)
 {
 	u_long tx3912fb_paddr = 0;
 	int size = (info->var.bits_per_pixel == 8) ? 256 : 16;
+	char *option = NULL;
 
-	tx3912fb_setup(fb_get_options("tx3912fb"));
+	if (fb_get_options("tx3912fb", &option))
+		return -ENODEV;
+	tx3912fb_setup(option);
 
 	/* Disable the video logic */
 	outl(inl(TX3912_VIDEO_CTRL1) &
diff -puN drivers/video/valkyriefb.c~fbcon-fix-fbcons-setup-routine drivers/video/valkyriefb.c
--- 25/drivers/video/valkyriefb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/valkyriefb.c	Mon Sep 20 12:56:42 2004
@@ -322,8 +322,11 @@ int __init valkyriefb_init(void)
 	struct fb_info_valkyrie	*p;
 	unsigned long frame_buffer_phys, cmap_regs_phys, flags;
 	int err;
+	char *option = NULL;
 
-	valkyriefb_setup(fb_get_options("valkyriefb"));
+	if (fb_get_options("valkyriefb", &option))
+		return -ENODEV;
+	valkyriefb_setup(option);
 
 #ifdef CONFIG_MAC
 	if (!MACH_IS_MAC)
diff -puN drivers/video/vesafb.c~fbcon-fix-fbcons-setup-routine drivers/video/vesafb.c
--- 25/drivers/video/vesafb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/vesafb.c	Mon Sep 20 12:56:42 2004
@@ -410,8 +410,11 @@ static struct platform_device vesafb_dev
 int __init vesafb_init(void)
 {
 	int ret;
+	char *option = NULL;
 
-	vesafb_setup(fb_get_options("vesafb"));
+	/* ignore error return of fb_get_options */
+	fb_get_options("vesafb", &option);
+	vesafb_setup(option);
 	ret = driver_register(&vesafb_driver);
 
 	if (!ret) {
diff -puN drivers/video/vfb.c~fbcon-fix-fbcons-setup-routine drivers/video/vfb.c
--- 25/drivers/video/vfb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/vfb.c	Mon Sep 20 12:56:42 2004
@@ -497,7 +497,11 @@ int __init vfb_init(void)
 	int ret = 0;
 
 #ifndef MODULE
-	vfb_setup(fb_get_options("vfb"));
+	char *option = NULL;
+
+	if (fb_get_options("vfb", &option))
+		return -ENODEV;
+	vfb_setup(option);
 #endif
 
 	if (!vfb_enable)
diff -puN drivers/video/vga16fb.c~fbcon-fix-fbcons-setup-routine drivers/video/vga16fb.c
--- 25/drivers/video/vga16fb.c~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/drivers/video/vga16fb.c	Mon Sep 20 12:56:42 2004
@@ -1342,9 +1342,13 @@ int __init vga16fb_init(void)
 {
 	int i;
 	int ret;
-
 #ifndef MODULE
-	vga16fb_setup(fb_get_options("vga16fb"));
+	char *option = NULL;
+
+	if (fb_get_options("vga16fb", &option))
+		return -ENODEV;
+
+	vga16fb_setup(option);
 #endif
 	printk(KERN_DEBUG "vga16fb: initializing\n");
 
diff -puN include/linux/fb.h~fbcon-fix-fbcons-setup-routine include/linux/fb.h
--- 25/include/linux/fb.h~fbcon-fix-fbcons-setup-routine	Mon Sep 20 12:56:42 2004
+++ 25-akpm/include/linux/fb.h	Mon Sep 20 12:56:42 2004
@@ -708,7 +708,7 @@ extern void fb_sysmove_buf_aligned(struc
 extern void fb_load_cursor_image(struct fb_info *);
 extern void fb_set_suspend(struct fb_info *info, int state);
 extern int fb_get_color_depth(struct fb_info *info);
-extern char* fb_get_options(char *name);
+extern int fb_get_options(char *name, char **option);
 
 extern struct fb_info *registered_fb[FB_MAX];
 extern int num_registered_fb;
_