staging: xgifb: delete incorrect I/O mapping
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 13 Mar 2011 10:26:13 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Mar 2011 18:52:27 +0000 (11:52 -0700)
If the PCI device was disabled when the probe() routine started, the
driver will create 256 MB video memory mapping which is never used or
properly released. It's also unsafe as the size is incorrect for many
video cards. Deleting it also allows eliminating XGIvga_enable global
variable.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/xgifb/XGI_main.h
drivers/staging/xgifb/XGI_main_26.c

index a014405cb4480b627c44b2e54d14558998055587..46b5958ddf37912105118bcfe63c82b8f809fd0b 100644 (file)
@@ -303,7 +303,6 @@ static u32 pseudo_palette[17];
 static int XGIfb_off = 0;
 static int XGIfb_crt1off = 0;
 static int XGIfb_forcecrt1 = -1;
-static int XGIvga_enabled = 0;
 static int XGIfb_userom = 0;
 //static int XGIfb_useoem = -1;
 
index 17f2aef30d160ed1f882fe3605db4351e1f6b01a..3aec3f1dbe88417108526830d8000a958e199ea7 100644 (file)
@@ -2163,7 +2163,6 @@ done:
 static int __devinit xgifb_probe(struct pci_dev *pdev,
                const struct pci_device_id *ent)
 {
-       u16 reg16;
        u8 reg, reg1;
        u8 CR48, CR38;
        int ret;
@@ -2180,9 +2179,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
 
        xgi_video_info.chip_id = pdev->device;
        pci_read_config_byte(pdev, PCI_REVISION_ID, &xgi_video_info.revision_id);
-       pci_read_config_word(pdev, PCI_COMMAND, &reg16);
        XGIhw_ext.jChipRevision = xgi_video_info.revision_id;
-       XGIvga_enabled = reg16 & 0x01;
 
        xgi_video_info.pcibus = pdev->bus->number;
        xgi_video_info.pcislot = PCI_SLOT(pdev->devfn);
@@ -2261,10 +2258,6 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
        }
        XGIhw_ext.pQueryVGAConfigSpace = &XGIfb_query_VGA_config_space;
 
-       if (!XGIvga_enabled) {
-               /* Mapping Max FB Size for 315 Init */
-               XGIhw_ext.pjVideoMemoryAddress = ioremap(xgi_video_info.video_base, 0x10000000);
-       }
        if (XGIfb_get_dram_size()) {
                printk(KERN_INFO "XGIfb: Fatal error: Unable to determine RAM size.\n");
                ret = -ENODEV;
This page took 0.027397 seconds and 5 git commands to generate.