Skip to content

Commit 0e95ed6

Browse files
Ma Junalexdeucher
authored andcommitted
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 <[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]
1 parent 9c783a1 commit 0e95ed6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,6 +4261,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev)
42614261
}
42624262
}
42634263

4264+
/*
4265+
* If gpu_od is the only member in the list, that means gpu_od is an
4266+
* empty directory, so remove it.
4267+
*/
4268+
if (list_is_singular(&adev->pm.od_kobj_list))
4269+
goto err_out;
4270+
42644271
return 0;
42654272

42664273
err_out:

0 commit comments

Comments
 (0)