Considering that there are multiple ways to instantiate a drm_debugfs_entry, as kms object's debugfs entries were introduced, split vc4_debugfs_regset32() into two functions: one to deal with the drm_printer and the other to instantiate the proper variables. Signed-off-by: Maíra Canal <mcanal@xxxxxxxxxx> --- drivers/gpu/drm/vc4/vc4_debugfs.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c index fac624a663ea..80afc69200f0 100644 --- a/drivers/gpu/drm/vc4/vc4_debugfs.c +++ b/drivers/gpu/drm/vc4/vc4_debugfs.c @@ -32,27 +32,34 @@ vc4_debugfs_init(struct drm_minor *minor) } } -static int vc4_debugfs_regset32(struct seq_file *m, void *unused) +static int vc4_debugfs_regset32(struct drm_device *drm, struct debugfs_regset32 *regset, + struct drm_printer *p) { - struct drm_debugfs_entry *entry = m->private; - struct drm_device *drm = entry->dev; - struct debugfs_regset32 *regset = entry->file.data; - struct drm_printer p = drm_seq_file_printer(m); int idx; if (!drm_dev_enter(drm, &idx)) return -ENODEV; - drm_print_regset32(&p, regset); + drm_print_regset32(p, regset); drm_dev_exit(idx); return 0; } +static int vc4_debugfs_dev_regset32(struct seq_file *m, void *unused) +{ + struct drm_debugfs_entry *entry = m->private; + struct drm_device *drm = entry->dev; + struct debugfs_regset32 *regset = entry->file.data; + struct drm_printer p = drm_seq_file_printer(m); + + return vc4_debugfs_regset32(drm, regset, &p); +} + void vc4_debugfs_add_regset32(struct drm_device *drm, const char *name, struct debugfs_regset32 *regset) { - drm_debugfs_add_file(drm, name, vc4_debugfs_regset32, regset); + drm_debugfs_add_file(drm, name, vc4_debugfs_dev_regset32, regset); } -- 2.39.0