Pull asus into release branch
[pandora-kernel.git] / drivers / sbus / char / vfc_dev.c
index 55b2b31..c3135e2 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/smp_lock.h>
 #include <linux/delay.h>
@@ -44,7 +43,7 @@
 #include "vfc.h"
 #include <asm/vfc_ioctls.h>
 
-static struct file_operations vfc_fops;
+static const struct file_operations vfc_fops;
 struct vfc_dev **vfc_dev_lst;
 static char vfcstr[]="vfc";
 static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
@@ -260,11 +259,10 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp)
                if (copy_from_user(&inout, argp, sizeof(inout)))
                        return -EFAULT;
 
-               buffer = kmalloc(inout.len, GFP_KERNEL);
+               buffer = kzalloc(inout.len, GFP_KERNEL);
                if (buffer == NULL)
                        return -ENOMEM;
 
-               memset(buffer,0,inout.len);
                vfc_lock_device(dev);
                inout.ret=
                        vfc_i2c_recvbuf(dev,inout.addr & 0xff
@@ -610,7 +608,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
        unsigned int map_size, ret, map_offset;
        struct vfc_dev *dev;
        
-       dev = vfc_get_dev_ptr(iminor(file->f_dentry->d_inode));
+       dev = vfc_get_dev_ptr(iminor(file->f_path.dentry->d_inode));
        if(dev == NULL)
                return -ENODEV;
 
@@ -633,7 +631,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
 }
 
 
-static struct file_operations vfc_fops = {
+static const struct file_operations vfc_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        vfc_ioctl,
@@ -659,7 +657,7 @@ static int vfc_probe(void)
        if (!cards)
                return -ENODEV;
 
-       vfc_dev_lst = (struct vfc_dev **)kmalloc(sizeof(struct vfc_dev *) *
+       vfc_dev_lst = kmalloc(sizeof(struct vfc_dev *) *
                                                 (cards+1),
                                                 GFP_KERNEL);
        if (vfc_dev_lst == NULL)