Skip to content

Commit fa0cf3e

Browse files
Liu Shixinlumag
authored andcommitted
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 <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/504252/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent f07c994 commit fa0cf3e

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ struct dpu_debugfs_regset32 {
194194
struct dpu_kms *dpu_kms;
195195
};
196196

197-
static int _dpu_debugfs_show_regset32(struct seq_file *s, void *data)
197+
static int dpu_regset32_show(struct seq_file *s, void *data)
198198
{
199199
struct dpu_debugfs_regset32 *regset = s->private;
200200
struct dpu_kms *dpu_kms = regset->dpu_kms;
@@ -227,19 +227,7 @@ static int _dpu_debugfs_show_regset32(struct seq_file *s, void *data)
227227

228228
return 0;
229229
}
230-
231-
static int dpu_debugfs_open_regset32(struct inode *inode,
232-
struct file *file)
233-
{
234-
return single_open(file, _dpu_debugfs_show_regset32, inode->i_private);
235-
}
236-
237-
static const struct file_operations dpu_fops_regset32 = {
238-
.open = dpu_debugfs_open_regset32,
239-
.read = seq_read,
240-
.llseek = seq_lseek,
241-
.release = single_release,
242-
};
230+
DEFINE_SHOW_ATTRIBUTE(dpu_regset32);
243231

244232
void dpu_debugfs_create_regset32(const char *name, umode_t mode,
245233
void *parent,
@@ -259,7 +247,7 @@ void dpu_debugfs_create_regset32(const char *name, umode_t mode,
259247
regset->blk_len = length;
260248
regset->dpu_kms = dpu_kms;
261249

262-
debugfs_create_file(name, mode, parent, regset, &dpu_fops_regset32);
250+
debugfs_create_file(name, mode, parent, regset, &dpu_regset32_fops);
263251
}
264252

265253
static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)

0 commit comments

Comments
 (0)