vserver 1.9.3
[linux-2.6.git] / drivers / video / sstfb.c
index d08d459..e3ea32b 100644 (file)
@@ -349,10 +349,10 @@ static int sst_calc_pll(const int freq, int *freq_out, struct pll_timing *t)
                if (m >= 128)
                        break;
                fout = (DAC_FREF * (m + 2)) / ((1 << p) * (n + 2));
-               if ((ABS(fout - freq) < best_err) && (m > 0)) {
+               if ((abs(fout - freq) < best_err) && (m > 0)) {
                        best_n = n;
                        best_m = m;
-                       best_err = ABS(fout - freq);
+                       best_err = abs(fout - freq);
                        /* we get the lowest m , allowing 0.5% error in freq*/
                        if (200*best_err < freq) break;
                }
@@ -790,7 +790,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file,
                
        /* fills lfb with #arg pixels */
        case _IOW('F', 0xdc, u32):      /* 0x46dc */
-               if (copy_from_user(&val, (void *)arg, sizeof(val)))
+               if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
                        return -EFAULT;
                if (val > info->fix.smem_len)
                        val = info->fix.smem_len;
@@ -801,7 +801,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file,
                
        /* change VGA pass_through mode */
        case _IOW('F', 0xdd, u32):      /* 0x46dd */
-               if (copy_from_user(&val, (void *)arg, sizeof(val)))
+               if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
                        return -EFAULT;
                pci_read_config_dword(sst_dev, PCI_INIT_ENABLE, &tmp);
                pci_write_config_dword(sst_dev, PCI_INIT_ENABLE,
@@ -1473,7 +1473,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
        f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
        f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
-       info->flags     = FBINFO_FLAG_DEFAULT;
+       info->flags     = FBINFO_DEFAULT;
        info->fbops     = &sstfb_ops;
        info->currcon   = -1;
        info->pseudo_palette = &all->pseudo_palette;
@@ -1571,6 +1571,13 @@ static struct pci_driver sstfb_driver = {
 
 int __devinit sstfb_init(void)
 {
+#ifndef MODULE
+       char *option = NULL;
+
+       if (fb_get_options("sstfb", &option))
+               return -ENODEV;
+       sstfb_setup(option);
+#endif
        return pci_module_init(&sstfb_driver);
 }
 
@@ -1693,9 +1700,9 @@ static void sstfb_drawdebugimage(struct fb_info *info)
        sstfb_drawrect_XY(info, 250, 250, 120, 100, 0xf800, idx);
 }
 
+module_init(sstfb_init);
 
 #ifdef MODULE
-module_init(sstfb_init);
 module_exit(sstfb_exit);
 #endif