OSDN Git Service

drm/amd/display: Remove redundant safeguards for dmub-srv destroy()
authorRoman Li <roman.li@amd.com>
Mon, 10 May 2021 15:29:29 +0000 (11:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 May 2021 16:25:19 +0000 (12:25 -0400)
[Why]
dc_dmub_srv_destroy() has internal null-check and null assignment.
No need to duplicate them externally.

[How]
Remove redundant safeguards.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 46910ec..6d541de 100644 (file)
@@ -1329,10 +1329,7 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
        }
 #endif
 
-       if (adev->dm.dc->ctx->dmub_srv) {
-               dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
-               adev->dm.dc->ctx->dmub_srv = NULL;
-       }
+       dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
 
        if (dc_enable_dmub_notifications(adev->dm.dc)) {
                kfree(adev->dm.dmub_notify);