]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] i810fb oops fix
authorAndrew Morton <akpm@osdl.org>
Fri, 1 Aug 2003 03:10:49 +0000 (20:10 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 1 Aug 2003 03:10:49 +0000 (20:10 -0700)
The module device table is not NULL-terminated, so we run off the end during
probing and oops.

Also, move all those static decls out of .h and into .c

drivers/video/i810/i810_main.c
drivers/video/i810/i810_main.h

index 5cf5e7d02b301698be624bf9f2de710b403c26d7..f4b423fca589fe818aebbd1d0d16df2f46d3e514 100644 (file)
 #include "i810.h"
 #include "i810_main.h"
 
+/* PCI */
+static const char *i810_pci_list[] __initdata = {
+       "Intel(R) 810 Framebuffer Device"                                 ,
+       "Intel(R) 810-DC100 Framebuffer Device"                           ,
+       "Intel(R) 810E Framebuffer Device"                                ,
+       "Intel(R) 815 (Internal Graphics 100Mhz FSB) Framebuffer Device"  ,
+       "Intel(R) 815 (Internal Graphics only) Framebuffer Device"        ,
+       "Intel(R) 815 (Internal Graphics with AGP) Framebuffer Device"
+};
+
+static struct pci_device_id i810fb_pci_tbl[] __initdata = {
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1  },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810E_IG,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
+       /* mvo: added i815 PCI-ID */
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_100,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_NOAGP,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_CGC,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 },
+       { 0 },
+};
+
+static struct pci_driver i810fb_driver = {
+       .name     =     "i810fb",
+       .id_table =     i810fb_pci_tbl,
+       .probe    =     i810fb_init_pci,
+       .remove   =     __exit_p(i810fb_remove_pci),
+       .suspend  =     i810fb_suspend,
+       .resume   =     i810fb_resume,
+};
+
+static int vram       __initdata = 4;
+static int bpp        __initdata = 8;
+static int mtrr       __initdata = 0;
+static int accel      __initdata = 0;
+static int hsync1     __initdata = 0;
+static int hsync2     __initdata = 0;
+static int vsync1     __initdata = 0;
+static int vsync2     __initdata = 0;
+static int xres       __initdata = 640;
+static int yres       __initdata = 480;
+static int vyres      __initdata = 0;
+static int sync       __initdata = 0;
+static int ext_vga    __initdata = 0;
+static int dcolor     __initdata = 0;
+
 /*------------------------------------------------------------*/
 
 /**************************************************************
index a2e569dbae2fc4a41581d5485590e2aee9249ca7..18b29a0b3227391149e90a0d57afce6639d05a3d 100644 (file)
 #ifndef __I810_MAIN_H__
 #define __I810_MAIN_H__
 
-/* PCI */
-static const char *i810_pci_list[] __initdata = {
-       "Intel(R) 810 Framebuffer Device"                                 ,
-       "Intel(R) 810-DC100 Framebuffer Device"                           ,
-       "Intel(R) 810E Framebuffer Device"                                ,
-       "Intel(R) 815 (Internal Graphics 100Mhz FSB) Framebuffer Device"  ,
-       "Intel(R) 815 (Internal Graphics only) Framebuffer Device"        , 
-       "Intel(R) 815 (Internal Graphics with AGP) Framebuffer Device"  
-};
-
-static struct pci_device_id i810fb_pci_tbl[] __initdata = {
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1, 
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3,
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1  },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810E_IG,
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
-       /* mvo: added i815 PCI-ID */  
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_100,
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_NOAGP,
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_CGC,
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }
-};       
-                    
 static int  __init i810fb_init_pci (struct pci_dev *dev, 
                                       const struct pci_device_id *entry);
 static void __exit i810fb_remove_pci(struct pci_dev *dev);
 static int i810fb_resume(struct pci_dev *dev);
 static int i810fb_suspend(struct pci_dev *dev, u32 state);
 
-static struct pci_driver i810fb_driver = {
-       .name     =     "i810fb",
-       .id_table =     i810fb_pci_tbl,
-       .probe    =     i810fb_init_pci,
-       .remove   =     __exit_p(i810fb_remove_pci),
-       .suspend  =     i810fb_suspend,
-       .resume   =     i810fb_resume,
-};     
-
-static int vram       __initdata = 4;
-static int bpp        __initdata = 8;
-static int mtrr       __initdata = 0;
-static int accel      __initdata = 0;
-static int hsync1     __initdata = 0;
-static int hsync2     __initdata = 0;
-static int vsync1     __initdata = 0;
-static int vsync2     __initdata = 0;
-static int xres       __initdata = 640;
-static int yres       __initdata = 480;
-static int vyres      __initdata = 0;
-static int sync       __initdata = 0;
-static int ext_vga    __initdata = 0;
-static int dcolor     __initdata = 0;
-
 /*
  * voffset - framebuffer offset in MiB from aperture start address.  In order for
  * the driver to work with X, we must try to use memory holes left untouched by X. The