]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/staging/dgrp/dgrp_dpa_ops.c
procfs: new helper - PDE_DATA(inode)
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / dgrp / dgrp_dpa_ops.c
index 021cca498f2c510ccb6bcd63a23582e39b094f16..43209c163a43c43401b4e2851b6e073c3970ff73 100644 (file)
@@ -52,7 +52,7 @@ static long dgrp_dpa_ioctl(struct file *file, unsigned int cmd,
                           unsigned long arg);
 static unsigned int dgrp_dpa_select(struct file *, struct poll_table_struct *);
 
-static const struct file_operations dpa_ops = {
+const struct file_operations dgrp_dpa_ops = {
        .owner   =  THIS_MODULE,
        .read    =  dgrp_dpa_read,
        .poll    =  dgrp_dpa_select,
@@ -61,12 +61,6 @@ static const struct file_operations dpa_ops = {
        .release =  dgrp_dpa_release,
 };
 
-static struct inode_operations dpa_inode_ops = {
-       .permission = dgrp_inode_permission
-};
-
-
-
 struct digi_node {
        uint    nd_state;               /* Node state: 1 = up, 0 = down. */
        uint    nd_chan_count;          /* Number of channels found */
@@ -111,17 +105,6 @@ struct digi_debug {
 #define DIGI_SETDEBUG      (('d'<<8) | 247)    /* set debug info */
 
 
-void dgrp_register_dpa_hook(struct proc_dir_entry *de)
-{
-       struct nd_struct *node = de->data;
-
-       de->proc_iops = &dpa_inode_ops;
-       de->proc_fops = &dpa_ops;
-
-       node->nd_dpa_de = de;
-       spin_lock_init(&node->nd_dpa_lock);
-}
-
 /*
  * dgrp_dpa_open -- open the DPA device for a particular PortServer
  */
@@ -130,8 +113,6 @@ static int dgrp_dpa_open(struct inode *inode, struct file *file)
        struct nd_struct *nd;
        int rtn = 0;
 
-       struct proc_dir_entry *de;
-
        rtn = try_module_get(THIS_MODULE);
        if (!rtn)
                return -ENXIO;
@@ -154,12 +135,7 @@ static int dgrp_dpa_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;