fbdev: move FBIO_WAITFORVSYNC to linux/fb.h
[safe/jmp/linux-2.6] / drivers / video / pm2fb.c
index 82aa824..27f93aa 100644 (file)
@@ -56,7 +56,7 @@
 #undef PM2FB_MASTER_DEBUG
 #ifdef PM2FB_MASTER_DEBUG
 #define DPRINTK(a, b...)       \
-       printk(KERN_DEBUG "pm2fb: %s: " a, __FUNCTION__ , ## b)
+       printk(KERN_DEBUG "pm2fb: %s: " a, __func__ , ## b)
 #else
 #define DPRINTK(a, b...)
 #endif
@@ -67,7 +67,7 @@
  * Driver data
  */
 static int hwcursor = 1;
-static char *mode __devinitdata;
+static char *mode_option __devinitdata;
 
 /*
  * The XFree GLINT driver will (I think to implement hardware cursor
@@ -896,7 +896,7 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
         * Pseudocolor:
         *    uses offset = 0 && length = DAC register width.
         *    var->{color}.offset is 0
-        *    var->{color}.length contains widht of DAC
+        *    var->{color}.length contains width of DAC
         *    cmap is not used
         *    DAC[X] is programmed to (red, green, blue)
         * Truecolor:
@@ -1680,10 +1680,10 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
                info->pixmap.scan_align = 1;
        }
 
-       if (!mode)
-               mode = "640x480@60";
+       if (!mode_option)
+               mode_option = "640x480@60";
 
-       err = fb_find_mode(&info->var, info, mode, NULL, 0, NULL, 8);
+       err = fb_find_mode(&info->var, info, mode_option, NULL, 0, NULL, 8);
        if (!err || err == 4)
                info->var = pm2fb_var;
 
@@ -1746,8 +1746,9 @@ static void __devexit pm2fb_remove(struct pci_dev *pdev)
        release_mem_region(fix->mmio_start, fix->mmio_len);
 
        pci_set_drvdata(pdev, NULL);
+       fb_dealloc_cmap(&info->cmap);
        kfree(info->pixmap.addr);
-       kfree(info);
+       framebuffer_release(info);
 }
 
 static struct pci_device_id pm2fb_id_table[] = {
@@ -1799,7 +1800,7 @@ static int __init pm2fb_setup(char *options)
                else if (!strncmp(this_opt, "noaccel", 7))
                        noaccel = 1;
                else
-                       mode = this_opt;
+                       mode_option = this_opt;
        }
        return 0;
 }
@@ -1835,8 +1836,10 @@ static void __exit pm2fb_exit(void)
 #ifdef MODULE
 module_exit(pm2fb_exit);
 
-module_param(mode, charp, 0);
-MODULE_PARM_DESC(mode, "Preferred video mode e.g. '648x480-8@60'");
+module_param(mode_option, charp, 0);
+MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'");
+module_param_named(mode, mode_option, charp, 0);
+MODULE_PARM_DESC(mode, "Initial video mode e.g. '648x480-8@60' (deprecated)");
 module_param(lowhsync, bool, 0);
 MODULE_PARM_DESC(lowhsync, "Force horizontal sync low regardless of mode");
 module_param(lowvsync, bool, 0);