mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
i915: Re-use DEFINE_SHOW_ATTRIBUTE() macro
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20180316141213.38774-1-andriy.shevchenko@linux.intel.com
This commit is contained in:
committed by
Chris Wilson
parent
1947fd133c
commit
e4006713d1
@@ -122,18 +122,7 @@ static int vgpu_mmio_diff_show(struct seq_file *s, void *unused)
|
||||
seq_printf(s, "Total: %d, Diff: %d\n", param.total, param.diff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vgpu_mmio_diff_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return single_open(file, vgpu_mmio_diff_show, inode->i_private);
|
||||
}
|
||||
|
||||
static const struct file_operations vgpu_mmio_diff_fops = {
|
||||
.open = vgpu_mmio_diff_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
DEFINE_SHOW_ATTRIBUTE(vgpu_mmio_diff);
|
||||
|
||||
/**
|
||||
* intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
|
||||
|
||||
Reference in New Issue
Block a user