diff options
author | Ma Jun <Jun.Ma2@amd.com> | 2024-04-16 12:30:12 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-04-24 06:22:46 +0300 |
commit | 0e95ed6452cb079cf9587c774a475a7d83c7e040 (patch) | |
tree | 8be9dd4d554ef75d3b012d6c1f807d7a951434bc /drivers/gpu | |
parent | 9c783a11214553a54f0915a7260a3ce624d36bf2 (diff) | |
download | linux-0e95ed6452cb079cf9587c774a475a7d83c7e040.tar.xz |
drm/amdgpu/pm: Remove gpu_od if it's an empty directory
gpu_od should be removed if it's an empty directory
Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reported-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index f09b9d49297e..bbd0169010c2 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -4261,6 +4261,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) } } + /* + * If gpu_od is the only member in the list, that means gpu_od is an + * empty directory, so remove it. + */ + if (list_is_singular(&adev->pm.od_kobj_list)) + goto err_out; + return 0; err_out: |