Index: drivers/video/stifb.c =================================================================== RCS file: /var/cvs/linux-2.6/drivers/video/stifb.c,v retrieving revision 1.13 diff -u -p -r1.13 stifb.c --- drivers/video/stifb.c 31 Oct 2004 21:07:55 -0000 1.13 +++ drivers/video/stifb.c 1 Nov 2004 12:40:26 -0000 @@ -1411,21 +1411,27 @@ stifb_init(void) def_sti = sti_get_rom(0); if (def_sti) { - for (i = 1; i < MAX_STI_ROMS; i++) { + /* initialize default sti before all others */ + for (i = 1; i <= MAX_STI_ROMS; i++) { sti = sti_get_rom(i); - if (sti == def_sti && bpp > 0) - stifb_force_bpp[i] = bpp; + if (sti != def_sti) + continue; + if (bpp > 0) + stifb_force_bpp[i-1] = bpp; + stifb_init_fb(def_sti, stifb_force_bpp[i-1]); + break; } - stifb_init_fb(def_sti, stifb_force_bpp[i]); } - for (i = 1; i < MAX_STI_ROMS; i++) { + for (i = 1; i <= MAX_STI_ROMS; i++) { sti = sti_get_rom(i); - if (!sti || sti==def_sti) + if (!sti) break; + if (sti == def_sti) + continue; if (bpp > 0) - stifb_force_bpp[i] = bpp; - stifb_init_fb(sti, stifb_force_bpp[i]); + stifb_force_bpp[i-1] = bpp; + stifb_init_fb(sti, stifb_force_bpp[i-1]); } return 0; }