]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/matrox/matroxfb_base.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[linux-2.6-omap-h63xx.git] / drivers / video / matrox / matroxfb_base.c
index c8559a756b75ff5bbe017c43cea941160d002168..86ca7b17900089f058b236986225addb846a6c85 100644 (file)
@@ -679,6 +679,8 @@ static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
                mga_outb(M_DAC_VAL, blue);
                break;
        case 16:
+               if (regno >= 16)
+                       break;
                {
                        u_int16_t col =
                                (red << ACCESS_FBINFO(fbcon).var.red.offset)     |
@@ -690,6 +692,8 @@ static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
                break;
        case 24:
        case 32:
+               if (regno >= 16)
+                       break;
                ACCESS_FBINFO(cmap[regno]) =
                        (red   << ACCESS_FBINFO(fbcon).var.red.offset)   |
                        (green << ACCESS_FBINFO(fbcon).var.green.offset) |
@@ -1994,7 +1998,6 @@ static void matroxfb_unregister_device(struct matrox_fb_info* minfo) {
 
 static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dummy) {
        struct board* b;
-       u_int8_t rev;
        u_int16_t svid;
        u_int16_t sid;
        struct matrox_fb_info* minfo;
@@ -2005,11 +2008,10 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
 #endif
        DBG(__FUNCTION__)
 
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
        svid = pdev->subsystem_vendor;
        sid = pdev->subsystem_device;
        for (b = dev_list; b->vendor; b++) {
-               if ((b->vendor != pdev->vendor) || (b->device != pdev->device) || (b->rev < rev)) continue;
+               if ((b->vendor != pdev->vendor) || (b->device != pdev->device) || (b->rev < pdev->revision)) continue;
                if (b->svid)
                        if ((b->svid != svid) || (b->sid != sid)) continue;
                break;