staging: xgifb: eliminate a global variable
authorAaro Koskinen <aaro.koskinen@iki.fi>
Thu, 17 Feb 2011 21:29:17 +0000 (23:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 20:38:19 +0000 (12:38 -0800)
Move the XGIfb_mmio_size global variable into the video_info struct.

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
drivers/staging/xgifb/XGIfb.h

index 72448e88fd8b1790a812e4aa80b133ecf3a023b4..e8e2bfe7557393aeeb1cb5832d88d5fbdc7f829c 100644 (file)
@@ -375,7 +375,6 @@ static struct xgi_hw_device_info XGIhw_ext;
 static struct vb_device_info  XGI_Pr;
 
 /* card parameters */
-static unsigned long XGIfb_mmio_size = 0;
 static u8            XGIfb_caps = 0;
 
 typedef enum _XGI_CMDTYPE {
index 6e86830cc52dfc5ac465f6628aa586c49ca7aac8..7f821ae20cf249c6fad7890eb1e7541e5e7986f5 100644 (file)
@@ -1723,7 +1723,7 @@ static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con,
        fix->ywrapstep = 0;
        fix->line_length = xgi_video_info.video_linelength;
        fix->mmio_start = xgi_video_info.mmio_base;
-       fix->mmio_len = XGIfb_mmio_size;
+       fix->mmio_len = xgi_video_info.mmio_size;
        if (xgi_video_info.chip >= XG40)
                fix->accel = FB_ACCEL_XGI_XABRE;
        else
@@ -2937,7 +2937,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
 
        xgi_video_info.video_base = pci_resource_start(pdev, 0);
        xgi_video_info.mmio_base = pci_resource_start(pdev, 1);
-       XGIfb_mmio_size = pci_resource_len(pdev, 1);
+       xgi_video_info.mmio_size = pci_resource_len(pdev, 1);
        xgi_video_info.vga_base = pci_resource_start(pdev, 2) + 0x30;
        XGIhw_ext.pjIOAddress = (unsigned char *)xgi_video_info.vga_base;
        /* XGI_Pr.RelIO  = ioremap(pci_resource_start(pdev, 2), 128) + 0x30; */
@@ -3101,7 +3101,9 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
                goto error;
        }
 
-       if (!request_mem_region(xgi_video_info.mmio_base, XGIfb_mmio_size, "XGIfb MMIO")) {
+       if (!request_mem_region(xgi_video_info.mmio_base,
+                               xgi_video_info.mmio_size,
+                               "XGIfb MMIO")) {
                printk(KERN_ERR "XGIfb: Fatal error: Unable to reserve MMIO region\n");
                ret = -ENODEV;
                goto error_0;
@@ -3109,13 +3111,15 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
 
        xgi_video_info.video_vbase = XGIhw_ext.pjVideoMemoryAddress =
        ioremap(xgi_video_info.video_base, xgi_video_info.video_size);
-       xgi_video_info.mmio_vbase = ioremap(xgi_video_info.mmio_base, XGIfb_mmio_size);
+       xgi_video_info.mmio_vbase = ioremap(xgi_video_info.mmio_base,
+                                           xgi_video_info.mmio_size);
 
        printk(KERN_INFO "XGIfb: Framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
                        xgi_video_info.video_base, xgi_video_info.video_vbase, xgi_video_info.video_size / 1024);
 
        printk(KERN_INFO "XGIfb: MMIO at 0x%lx, mapped to 0x%p, size %ldk\n",
-                       xgi_video_info.mmio_base, xgi_video_info.mmio_vbase, XGIfb_mmio_size / 1024);
+              xgi_video_info.mmio_base, xgi_video_info.mmio_vbase,
+              xgi_video_info.mmio_size / 1024);
        printk("XGIfb: XGIInitNew() ...");
        if (XGIInitNew(&XGIhw_ext))
                printk("OK\n");
@@ -3410,7 +3414,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
 error_1:
        iounmap(xgi_video_info.mmio_vbase);
        iounmap(xgi_video_info.video_vbase);
-       release_mem_region(xgi_video_info.mmio_base, XGIfb_mmio_size);
+       release_mem_region(xgi_video_info.mmio_base, xgi_video_info.mmio_size);
 error_0:
        release_mem_region(xgi_video_info.video_base,
                           xgi_video_info.video_size);
@@ -3431,7 +3435,7 @@ static void __devexit xgifb_remove(struct pci_dev *pdev)
        unregister_framebuffer(fb_info);
        iounmap(xgi_video_info.mmio_vbase);
        iounmap(xgi_video_info.video_vbase);
-       release_mem_region(xgi_video_info.mmio_base, XGIfb_mmio_size);
+       release_mem_region(xgi_video_info.mmio_base, xgi_video_info.mmio_size);
        release_mem_region(xgi_video_info.video_base,
                           xgi_video_info.video_size);
        vfree(XGIhw_ext.pjVirtualRomBase);
index ef86a64d699600f9d291c83e5782a3c4e235475e..bb4640abda98ec8e8634663b4a689fde7baa2148 100644 (file)
@@ -161,6 +161,7 @@ struct video_info{
         unsigned long video_base;
         char  *       video_vbase;
         unsigned long mmio_base;
+       unsigned long mmio_size;
         char  *       mmio_vbase;
         unsigned long vga_base;
         unsigned long mtrr;