mirror of https://github.com/torvalds/linux.git
drm/msm/dpu: use DEFINE_SHOW_ATTRIBUTE to simplify dpu_regset32
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/504252/ Link: https://lore.kernel.org/r/20220922142147.3246649-1-liushixin2@huawei.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
parent
f07c9946cc
commit
fa0cf3e476
|
|
@ -194,7 +194,7 @@ struct dpu_debugfs_regset32 {
|
|||
struct dpu_kms *dpu_kms;
|
||||
};
|
||||
|
||||
static int _dpu_debugfs_show_regset32(struct seq_file *s, void *data)
|
||||
static int dpu_regset32_show(struct seq_file *s, void *data)
|
||||
{
|
||||
struct dpu_debugfs_regset32 *regset = s->private;
|
||||
struct dpu_kms *dpu_kms = regset->dpu_kms;
|
||||
|
|
@ -227,19 +227,7 @@ static int _dpu_debugfs_show_regset32(struct seq_file *s, void *data)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dpu_debugfs_open_regset32(struct inode *inode,
|
||||
struct file *file)
|
||||
{
|
||||
return single_open(file, _dpu_debugfs_show_regset32, inode->i_private);
|
||||
}
|
||||
|
||||
static const struct file_operations dpu_fops_regset32 = {
|
||||
.open = dpu_debugfs_open_regset32,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
DEFINE_SHOW_ATTRIBUTE(dpu_regset32);
|
||||
|
||||
void dpu_debugfs_create_regset32(const char *name, umode_t mode,
|
||||
void *parent,
|
||||
|
|
@ -259,7 +247,7 @@ void dpu_debugfs_create_regset32(const char *name, umode_t mode,
|
|||
regset->blk_len = length;
|
||||
regset->dpu_kms = dpu_kms;
|
||||
|
||||
debugfs_create_file(name, mode, parent, regset, &dpu_fops_regset32);
|
||||
debugfs_create_file(name, mode, parent, regset, &dpu_regset32_fops);
|
||||
}
|
||||
|
||||
static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
|
||||
|
|
|
|||
Loading…
Reference in New Issue