diff options
author | Ma Jun <Jun.Ma2@amd.com> | 2024-04-16 11:30:12 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-04-23 18:08:30 +0200 |
commit | 69bc7a8a61aaa71e7cba1065484c421e7556edcc (patch) | |
tree | f3f0370e27490657e5b677c60cfd04291ca0e9d1 /drivers/gpu/drm/amd/pm/amdgpu_pm.c | |
parent | drm/amdkfd: demote unsupported device messages to dev_info (diff) | |
download | linux-69bc7a8a61aaa71e7cba1065484c421e7556edcc.tar.xz linux-69bc7a8a61aaa71e7cba1065484c421e7556edcc.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
-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 5bc1cd4993e8..569bc6e61b77 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -4338,6 +4338,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: |