]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/msm/dpu: use DEFINE_SHOW_ATTRIBUTE to simplify dpu_regset32
authorLiu Shixin <liushixin2@huawei.com>
Thu, 22 Sep 2022 14:21:47 +0000 (22:21 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 2 Nov 2022 16:06:00 +0000 (19:06 +0300)
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>
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

index 5e6e2626151e8d174f8ce78facb7cc0e2e0a2361..f3660cd14f4f036b380e97846d3f3696621e9da9 100644 (file)
@@ -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)