diff options
| author | Ma Jun <[email protected]> | 2024-04-16 17:30:12 +0800 | 
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-04-23 12:08:30 -0400 | 
| commit | 69bc7a8a61aaa71e7cba1065484c421e7556edcc (patch) | |
| tree | f3f0370e27490657e5b677c60cfd04291ca0e9d1 /drivers/gpu/drm/amd/pm/amdgpu_pm.c | |
| parent | 80f071a343cc382df2d5cbddeb3d708657a83600 (diff) | |
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]>
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:  |