Merge to Fedora kernel-2.6.7-1.441
[linux-2.6.git] / drivers / video / fbmem.c
index 80d81e3..65a4021 100644 (file)
@@ -172,6 +172,7 @@ extern int kyrofb_init(void);
 extern int kyrofb_setup(char*);
 extern int mc68x328fb_init(void);
 extern int mc68x328fb_setup(char *);
+extern int asiliantfb_init(void);
 
 static struct {
        const char *name;
@@ -385,6 +386,9 @@ static struct {
 #ifdef CONFIG_FB_68328
        { "68328fb", mc68x328fb_init, mc68x328fb_setup },
 #endif
+#ifdef CONFIG_FB_ASILIANT
+       { "asiliantfb", asiliantfb_init, NULL },
+#endif
 
        /*
         * Generic drivers that don't use resource management (yet)
@@ -802,7 +806,7 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset,
 }
 
 static ssize_t
-fb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
        unsigned long p = *ppos;
        struct inode *inode = file->f_dentry->d_inode;
@@ -839,7 +843,7 @@ fb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 }
 
 static ssize_t
-fb_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
        unsigned long p = *ppos;
        struct inode *inode = file->f_dentry->d_inode;
@@ -916,26 +920,30 @@ fb_cursor(struct fb_info *info, struct fb_cursor *sprite)
        
        if (cursor.set & FB_CUR_SETSHAPE) {
                int size = ((cursor.image.width + 7) >> 3) * cursor.image.height;               
+               char *data, *mask;
+
                if ((cursor.image.height != info->cursor.image.height) ||
                    (cursor.image.width != info->cursor.image.width))
                        cursor.set |= FB_CUR_SETSIZE;
                
-               cursor.image.data = kmalloc(size, GFP_KERNEL);
-               if (!cursor.image.data)
+               data = kmalloc(size, GFP_KERNEL);
+               if (!data)
                        return -ENOMEM;
                
-               cursor.mask = kmalloc(size, GFP_KERNEL);
-               if (!cursor.mask) {
-                       kfree(cursor.image.data);
+               mask = kmalloc(size, GFP_KERNEL);
+               if (!mask) {
+                       kfree(data);
                        return -ENOMEM;
                }
                
-               if (copy_from_user(cursor.image.data, sprite->image.data, size) ||
-                   copy_from_user(cursor.mask, sprite->mask, size)) { 
-                       kfree(cursor.image.data);
-                       kfree(cursor.mask);
+               if (copy_from_user(data, sprite->image.data, size) ||
+                   copy_from_user(mask, sprite->mask, size)) {
+                       kfree(data);
+                       kfree(mask);
                        return -EFAULT;
                }
+               cursor.image.data = data;
+               cursor.mask = mask;
        }
        info->cursor.set = cursor.set;
        info->cursor.rop = cursor.rop;