From 5b54d6797994fe93432970145c93b9747a3c8d6c Mon Sep 17 00:00:00 2001 From: Nirmoy Das Date: Wed, 17 Feb 2021 18:34:30 -0500 Subject: drm/radeon: do not use drm middle layer for debugfs (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use debugfs API directly instead of drm middle layer. v2: squash in build fix (Alex) Signed-off-by: Nirmoy Das Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/rs400.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'drivers/gpu/drm/radeon/rs400.c') diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 117f60af1ee4..8423bcc3302b 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -38,7 +37,7 @@ #include "rs400d.h" /* This files gather functions specifics to : rs400,rs480 */ -static int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev); +static void rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev); void rs400_gart_adjust_size(struct radeon_device *rdev) { @@ -103,8 +102,7 @@ int rs400_gart_init(struct radeon_device *rdev) r = radeon_gart_init(rdev); if (r) return r; - if (rs400_debugfs_pcie_gart_info_init(rdev)) - DRM_ERROR("Failed to register debugfs file for RS400 GART !\n"); + rs400_debugfs_pcie_gart_info_init(rdev); rdev->gart.table_size = rdev->gart.num_gpu_pages * 4; return radeon_gart_table_ram_alloc(rdev); } @@ -307,11 +305,9 @@ void rs400_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) } #if defined(CONFIG_DEBUG_FS) -static int rs400_debugfs_gart_info(struct seq_file *m, void *data) +static int rs400_debugfs_gart_info_show(struct seq_file *m, void *unused) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; - struct radeon_device *rdev = dev->dev_private; + struct radeon_device *rdev = (struct radeon_device *)m->private; uint32_t tmp; tmp = RREG32(RADEON_HOST_PATH_CNTL); @@ -376,17 +372,16 @@ static int rs400_debugfs_gart_info(struct seq_file *m, void *data) return 0; } -static struct drm_info_list rs400_gart_info_list[] = { - {"rs400_gart_info", rs400_debugfs_gart_info, 0, NULL}, -}; +DEFINE_SHOW_ATTRIBUTE(rs400_debugfs_gart_info); #endif -static int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) +static void rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) { #if defined(CONFIG_DEBUG_FS) - return radeon_debugfs_add_files(rdev, rs400_gart_info_list, 1); -#else - return 0; + struct dentry *root = rdev->ddev->primary->debugfs_root; + + debugfs_create_file("rs400_gart_info", 0444, root, rdev, + &rs400_debugfs_gart_info_fops); #endif } -- cgit v1.2.3