drm/i915: refactor debugfs open function
Only forcewake has an open with special semantics, the other r/w debugfs only assign the file private pointer. Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
39965b3766
commit
08e14e80d0
1 changed files with 5 additions and 21 deletions
|
@ -1415,8 +1415,8 @@ static int i915_gen6_forcewake_count_info(struct seq_file *m, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
i915_wedged_open(struct inode *inode,
|
i915_debugfs_common_open(struct inode *inode,
|
||||||
struct file *filp)
|
struct file *filp)
|
||||||
{
|
{
|
||||||
filp->private_data = inode->i_private;
|
filp->private_data = inode->i_private;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1472,20 +1472,12 @@ i915_wedged_write(struct file *filp,
|
||||||
|
|
||||||
static const struct file_operations i915_wedged_fops = {
|
static const struct file_operations i915_wedged_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = i915_wedged_open,
|
.open = i915_debugfs_common_open,
|
||||||
.read = i915_wedged_read,
|
.read = i915_wedged_read,
|
||||||
.write = i915_wedged_write,
|
.write = i915_wedged_write,
|
||||||
.llseek = default_llseek,
|
.llseek = default_llseek,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
|
||||||
i915_max_freq_open(struct inode *inode,
|
|
||||||
struct file *filp)
|
|
||||||
{
|
|
||||||
filp->private_data = inode->i_private;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
i915_max_freq_read(struct file *filp,
|
i915_max_freq_read(struct file *filp,
|
||||||
char __user *ubuf,
|
char __user *ubuf,
|
||||||
|
@ -1542,20 +1534,12 @@ i915_max_freq_write(struct file *filp,
|
||||||
|
|
||||||
static const struct file_operations i915_max_freq_fops = {
|
static const struct file_operations i915_max_freq_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = i915_max_freq_open,
|
.open = i915_debugfs_common_open,
|
||||||
.read = i915_max_freq_read,
|
.read = i915_max_freq_read,
|
||||||
.write = i915_max_freq_write,
|
.write = i915_max_freq_write,
|
||||||
.llseek = default_llseek,
|
.llseek = default_llseek,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
|
||||||
i915_cache_sharing_open(struct inode *inode,
|
|
||||||
struct file *filp)
|
|
||||||
{
|
|
||||||
filp->private_data = inode->i_private;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
i915_cache_sharing_read(struct file *filp,
|
i915_cache_sharing_read(struct file *filp,
|
||||||
char __user *ubuf,
|
char __user *ubuf,
|
||||||
|
@ -1621,7 +1605,7 @@ i915_cache_sharing_write(struct file *filp,
|
||||||
|
|
||||||
static const struct file_operations i915_cache_sharing_fops = {
|
static const struct file_operations i915_cache_sharing_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = i915_cache_sharing_open,
|
.open = i915_debugfs_common_open,
|
||||||
.read = i915_cache_sharing_read,
|
.read = i915_cache_sharing_read,
|
||||||
.write = i915_cache_sharing_write,
|
.write = i915_cache_sharing_write,
|
||||||
.llseek = default_llseek,
|
.llseek = default_llseek,
|
||||||
|
|
Loading…
Add table
Reference in a new issue