Commit 21cc57fb authored by Wei Yongjun's avatar Wei Yongjun Committed by Jeff Kirsher

ixgbe: convert to use simple_open()

This removes an open coded simple_open() function and
replaces file operations references to the function
with simple_open() instead.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 8ad88e37
...@@ -36,20 +36,6 @@ static struct dentry *ixgbe_dbg_root; ...@@ -36,20 +36,6 @@ static struct dentry *ixgbe_dbg_root;
static char ixgbe_dbg_reg_ops_buf[256] = ""; static char ixgbe_dbg_reg_ops_buf[256] = "";
/**
* ixgbe_dbg_reg_ops_open - prep the debugfs pokee data item when opened
* @inode: inode that was opened
* @filp: file info
*
* Stash the adapter pointer hiding in the inode into the file pointer where
* we can find it later in the read and write calls
**/
static int ixgbe_dbg_reg_ops_open(struct inode *inode, struct file *filp)
{
filp->private_data = inode->i_private;
return 0;
}
/** /**
* ixgbe_dbg_reg_ops_read - read for reg_ops datum * ixgbe_dbg_reg_ops_read - read for reg_ops datum
* @filp: the opened file * @filp: the opened file
...@@ -142,27 +128,13 @@ static ssize_t ixgbe_dbg_reg_ops_write(struct file *filp, ...@@ -142,27 +128,13 @@ static ssize_t ixgbe_dbg_reg_ops_write(struct file *filp,
static const struct file_operations ixgbe_dbg_reg_ops_fops = { static const struct file_operations ixgbe_dbg_reg_ops_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = ixgbe_dbg_reg_ops_open, .open = simple_open,
.read = ixgbe_dbg_reg_ops_read, .read = ixgbe_dbg_reg_ops_read,
.write = ixgbe_dbg_reg_ops_write, .write = ixgbe_dbg_reg_ops_write,
}; };
static char ixgbe_dbg_netdev_ops_buf[256] = ""; static char ixgbe_dbg_netdev_ops_buf[256] = "";
/**
* ixgbe_dbg_netdev_ops_open - prep the debugfs netdev_ops data item
* @inode: inode that was opened
* @filp: file info
*
* Stash the adapter pointer hiding in the inode into the file pointer
* where we can find it later in the read and write calls
**/
static int ixgbe_dbg_netdev_ops_open(struct inode *inode, struct file *filp)
{
filp->private_data = inode->i_private;
return 0;
}
/** /**
* ixgbe_dbg_netdev_ops_read - read for netdev_ops datum * ixgbe_dbg_netdev_ops_read - read for netdev_ops datum
* @filp: the opened file * @filp: the opened file
...@@ -238,7 +210,7 @@ static ssize_t ixgbe_dbg_netdev_ops_write(struct file *filp, ...@@ -238,7 +210,7 @@ static ssize_t ixgbe_dbg_netdev_ops_write(struct file *filp,
static const struct file_operations ixgbe_dbg_netdev_ops_fops = { static const struct file_operations ixgbe_dbg_netdev_ops_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = ixgbe_dbg_netdev_ops_open, .open = simple_open,
.read = ixgbe_dbg_netdev_ops_read, .read = ixgbe_dbg_netdev_ops_read,
.write = ixgbe_dbg_netdev_ops_write, .write = ixgbe_dbg_netdev_ops_write,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment