]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/dgrp/dgrp_net_ops.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / staging / dgrp / dgrp_net_ops.c
index e6018823b9deca9079ff3ee72251a5669ad99b2f..5b7833f593ff7a8909ca74a7a10a43d638626004 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <linux/module.h>
 #include <linux/proc_fs.h>
-#include <linux/types.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/device.h>
 #include <linux/tty.h>
@@ -72,7 +72,7 @@ static long dgrp_net_ioctl(struct file *file, unsigned int cmd,
 static unsigned int dgrp_net_select(struct file *file,
                                    struct poll_table_struct *table);
 
-static const struct file_operations net_ops = {
+const struct file_operations dgrp_net_ops = {
        .owner   =  THIS_MODULE,
        .read    =  dgrp_net_read,
        .write   =  dgrp_net_write,
@@ -82,23 +82,6 @@ static const struct file_operations net_ops = {
        .release =  dgrp_net_release,
 };
 
-static struct inode_operations net_inode_ops = {
-       .permission = dgrp_inode_permission
-};
-
-void dgrp_register_net_hook(struct proc_dir_entry *de)
-{
-       struct nd_struct *node = de->data;
-
-       de->proc_iops = &net_inode_ops;
-       de->proc_fops = &net_ops;
-       node->nd_net_de = de;
-       sema_init(&node->nd_net_semaphore, 1);
-       node->nd_state = NS_CLOSED;
-       dgrp_create_node_class_sysfs_files(node);
-}
-
-
 /**
  * dgrp_dump() -- prints memory for debugging purposes.
  * @mem: Memory location which should be printed to the console
@@ -801,7 +784,6 @@ out_err:
 static int dgrp_net_open(struct inode *inode, struct file *file)
 {
        struct nd_struct *nd;
-       struct proc_dir_entry *de;
        ulong  lock_flags;
        int rtn;
 
@@ -825,13 +807,7 @@ static int dgrp_net_open(struct inode *inode, struct file *file)
        /*
         *  Get the node pointer, and fail if it doesn't exist.
         */
-       de = PDE(inode);
-       if (!de) {
-               rtn = -ENXIO;
-               goto done;
-       }
-
-       nd = (struct nd_struct *) de->data;
+       nd = PDE_DATA(inode);
        if (!nd) {
                rtn = -ENXIO;
                goto done;
@@ -3405,7 +3381,7 @@ static long dgrp_net_ioctl(struct file *file, unsigned int cmd,
                if (size != sizeof(struct link_struct))
                        return -EINVAL;
 
-               if (copy_from_user((void *)(&link), (void __user *) arg, size))
+               if (copy_from_user(&link, (void __user *)arg, size))
                        return -EFAULT;
 
                if (link.lk_fast_rate < 9600)