]> Git Repo - linux.git/commitdiff
drm/amdgpu/pm: Remove gpu_od if it's an empty directory
authorMa Jun <[email protected]>
Tue, 16 Apr 2024 09:30:12 +0000 (17:30 +0800)
committerAlex Deucher <[email protected]>
Wed, 24 Apr 2024 03:22:46 +0000 (23:22 -0400)
gpu_od should be removed if it's an empty directory

Signed-off-by: Ma Jun <[email protected]>
Reported-by: Yang Wang <[email protected]>
Reviewed-by: Yang Wang <[email protected]>
Suggested-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index f09b9d49297e815f469cc54be1c1130711576a12..bbd0169010c2d50a2454e64f53342a9304ac6e89 100644 (file)
@@ -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:
This page took 0.059776 seconds and 4 git commands to generate.