Skip to content

Commit

Permalink
drm/radeon: cleanup debugfs
Browse files Browse the repository at this point in the history
Remove unnecessary debugfs dentries and also radeon_ttm_debugfs_fini()
as drm_debugfs_cleanup() will recursively remove debugfs files.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Nirmoy Das authored and Alex Deucher committed Feb 18, 2021
1 parent 88293c0 commit ba3d940
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
5 changes: 0 additions & 5 deletions drivers/gpu/drm/radeon/radeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,6 @@ struct radeon_surface_reg {
struct radeon_mman {
struct ttm_bo_device bdev;
bool initialized;

#if defined(CONFIG_DEBUG_FS)
struct dentry *vram;
struct dentry *gtt;
#endif
};

struct radeon_bo_list {
Expand Down
24 changes: 5 additions & 19 deletions drivers/gpu/drm/radeon/radeon_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "radeon_ttm.h"

static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);

static int radeon_ttm_tt_bind(struct ttm_bo_device *bdev,
struct ttm_tt *ttm,
Expand Down Expand Up @@ -777,7 +776,7 @@ void radeon_ttm_fini(struct radeon_device *rdev)

if (!rdev->mman.initialized)
return;
radeon_ttm_debugfs_fini(rdev);

if (rdev->stolen_vga_memory) {
r = radeon_bo_reserve(rdev->stolen_vga_memory, false);
if (r == 0) {
Expand Down Expand Up @@ -1010,12 +1009,11 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
struct drm_minor *minor = rdev->ddev->primary;
struct dentry *root = minor->debugfs_root;

rdev->mman.vram = debugfs_create_file("radeon_vram", S_IFREG | S_IRUGO,
root, rdev,
&radeon_ttm_vram_fops);
debugfs_create_file("radeon_vram", S_IFREG | S_IRUGO, root, rdev,
&radeon_ttm_vram_fops);

rdev->mman.gtt = debugfs_create_file("radeon_gtt", S_IFREG | S_IRUGO,
root, rdev, &radeon_ttm_gtt_fops);
debugfs_create_file("radeon_gtt", S_IFREG | S_IRUGO, root, rdev,
&radeon_ttm_gtt_fops);

count = ARRAY_SIZE(radeon_ttm_debugfs_list);

Expand All @@ -1025,15 +1023,3 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
return 0;
#endif
}

static void radeon_ttm_debugfs_fini(struct radeon_device *rdev)
{
#if defined(CONFIG_DEBUG_FS)

debugfs_remove(rdev->mman.vram);
rdev->mman.vram = NULL;

debugfs_remove(rdev->mman.gtt);
rdev->mman.gtt = NULL;
#endif
}

0 comments on commit ba3d940

Please sign in to comment.