Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[pandora-kernel.git] / drivers / sbus / char / vfc_dev.c
index ddcd330..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] = {
@@ -164,10 +163,6 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
                return -EINVAL;
        if (init_vfc_hw(dev))
                return -EIO;
-
-       devfs_mk_cdev(MKDEV(VFC_MAJOR, instance),
-                       S_IFCHR | S_IRUSR | S_IWUSR,
-                       "vfc/%d", instance);
        return 0;
 }
 
@@ -264,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
@@ -614,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;
 
@@ -637,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,
@@ -663,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)
@@ -677,7 +671,6 @@ static int vfc_probe(void)
                kfree(vfc_dev_lst);
                return -EIO;
        }
-       devfs_mk_dir("vfc");
        instance = 0;
        for_all_sbusdev(sdev, sbus) {
                if (strcmp(sdev->prom_name, "vfc") == 0) {
@@ -717,7 +710,6 @@ static void deinit_vfc_device(struct vfc_dev *dev)
 {
        if(dev == NULL)
                return;
-       devfs_remove("vfc/%d", dev->instance);
        sbus_iounmap(dev->regs, sizeof(struct vfc_regs));
        kfree(dev);
 }
@@ -731,7 +723,6 @@ void cleanup_module(void)
        for (devp = vfc_dev_lst; *devp; devp++)
                deinit_vfc_device(*devp);
 
-       devfs_remove("vfc");
        kfree(vfc_dev_lst);
        return;
 }