aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index b51e15725c6..31b1f4bf133 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -981,7 +981,7 @@ struct radeon_debugfs {
981 struct drm_info_list *files; 981 struct drm_info_list *files;
982 unsigned num_files; 982 unsigned num_files;
983}; 983};
984static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_NUM_FILES]; 984static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_COMPONENTS];
985static unsigned _radeon_debugfs_count = 0; 985static unsigned _radeon_debugfs_count = 0;
986 986
987int radeon_debugfs_add_files(struct radeon_device *rdev, 987int radeon_debugfs_add_files(struct radeon_device *rdev,
@@ -996,14 +996,17 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
996 return 0; 996 return 0;
997 } 997 }
998 } 998 }
999 if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) { 999
1000 DRM_ERROR("Reached maximum number of debugfs files.\n"); 1000 i = _radeon_debugfs_count + 1;
1001 DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n"); 1001 if (i > RADEON_DEBUGFS_MAX_COMPONENTS) {
1002 DRM_ERROR("Reached maximum number of debugfs components.\n");
1003 DRM_ERROR("Report so we increase "
1004 "RADEON_DEBUGFS_MAX_COMPONENTS.\n");
1002 return -EINVAL; 1005 return -EINVAL;
1003 } 1006 }
1004 _radeon_debugfs[_radeon_debugfs_count].files = files; 1007 _radeon_debugfs[_radeon_debugfs_count].files = files;
1005 _radeon_debugfs[_radeon_debugfs_count].num_files = nfiles; 1008 _radeon_debugfs[_radeon_debugfs_count].num_files = nfiles;
1006 _radeon_debugfs_count++; 1009 _radeon_debugfs_count = i;
1007#if defined(CONFIG_DEBUG_FS) 1010#if defined(CONFIG_DEBUG_FS)
1008 drm_debugfs_create_files(files, nfiles, 1011 drm_debugfs_create_files(files, nfiles,
1009 rdev->ddev->control->debugfs_root, 1012 rdev->ddev->control->debugfs_root,