mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: cleanup debugfs for amdgpu rings
Use debugfs_create_file_size API for creating ring debugfs, and as its a NULL returning API, change the return type for amdgpu_debugfs_ring_init API as well. Also cleanup surrounding code. Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Shashank Sharma <shashank.sharma@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -415,26 +415,20 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {
|
||||
|
||||
#endif
|
||||
|
||||
int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
|
||||
struct amdgpu_ring *ring)
|
||||
void amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
|
||||
struct amdgpu_ring *ring)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG_FS)
|
||||
struct drm_minor *minor = adev_to_drm(adev)->primary;
|
||||
struct dentry *ent, *root = minor->debugfs_root;
|
||||
struct dentry *root = minor->debugfs_root;
|
||||
char name[32];
|
||||
|
||||
sprintf(name, "amdgpu_ring_%s", ring->name);
|
||||
debugfs_create_file_size(name, S_IFREG | S_IRUGO, root, ring,
|
||||
&amdgpu_debugfs_ring_fops,
|
||||
ring->ring_size + 12);
|
||||
|
||||
ent = debugfs_create_file(name,
|
||||
S_IFREG | S_IRUGO, root,
|
||||
ring, &amdgpu_debugfs_ring_fops);
|
||||
if (IS_ERR(ent))
|
||||
return PTR_ERR(ent);
|
||||
|
||||
i_size_write(ent->d_inode, ring->ring_size + 12);
|
||||
ring->ent = ent;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user