drm/amdgpu: use IS_ERR for debugfs APIs
debugfs APIs returns encoded error so use IS_ERR for checking return value. v2: return PTR_ERR(ent) References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-By: Shashank Sharma <shashank.sharma@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
7bbee36d71
commit
b04ce53eac
|
@ -1544,20 +1544,18 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
|
|||
struct dentry *ent;
|
||||
int r, i;
|
||||
|
||||
|
||||
|
||||
ent = debugfs_create_file("amdgpu_preempt_ib", 0600, root, adev,
|
||||
&fops_ib_preempt);
|
||||
if (!ent) {
|
||||
if (IS_ERR(ent)) {
|
||||
DRM_ERROR("unable to create amdgpu_preempt_ib debugsfs file\n");
|
||||
return -EIO;
|
||||
return PTR_ERR(ent);
|
||||
}
|
||||
|
||||
ent = debugfs_create_file("amdgpu_force_sclk", 0200, root, adev,
|
||||
&fops_sclk_set);
|
||||
if (!ent) {
|
||||
if (IS_ERR(ent)) {
|
||||
DRM_ERROR("unable to create amdgpu_set_sclk debugsfs file\n");
|
||||
return -EIO;
|
||||
return PTR_ERR(ent);
|
||||
}
|
||||
|
||||
/* Register debugfs entries for amdgpu_ttm */
|
||||
|
|
|
@ -428,8 +428,8 @@ int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
|
|||
ent = debugfs_create_file(name,
|
||||
S_IFREG | S_IRUGO, root,
|
||||
ring, &amdgpu_debugfs_ring_fops);
|
||||
if (!ent)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(ent))
|
||||
return PTR_ERR(ent);
|
||||
|
||||
i_size_write(ent->d_inode, ring->ring_size + 12);
|
||||
ring->ent = ent;
|
||||
|
|
Loading…
Reference in New Issue