Commit e96b1b29 authored by Nirmoy Das's avatar Nirmoy Das Committed by Alex Deucher

drm/amdgpu/display: remove hdcp_srm sysfs on device removal

Fixes: 9037246b ("drm/amd/display: Add sysfs interface for set/get srm")
Signed-off-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4112c003
...@@ -1128,7 +1128,7 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) ...@@ -1128,7 +1128,7 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
if (adev->dm.hdcp_workqueue) { if (adev->dm.hdcp_workqueue) {
hdcp_destroy(adev->dm.hdcp_workqueue); hdcp_destroy(&adev->dev->kobj, adev->dm.hdcp_workqueue);
adev->dm.hdcp_workqueue = NULL; adev->dm.hdcp_workqueue = NULL;
} }
......
...@@ -376,7 +376,7 @@ static void event_cpirq(struct work_struct *work) ...@@ -376,7 +376,7 @@ static void event_cpirq(struct work_struct *work)
} }
void hdcp_destroy(struct hdcp_workqueue *hdcp_work) void hdcp_destroy(struct kobject *kobj, struct hdcp_workqueue *hdcp_work)
{ {
int i = 0; int i = 0;
...@@ -385,6 +385,7 @@ void hdcp_destroy(struct hdcp_workqueue *hdcp_work) ...@@ -385,6 +385,7 @@ void hdcp_destroy(struct hdcp_workqueue *hdcp_work)
cancel_delayed_work_sync(&hdcp_work[i].watchdog_timer_dwork); cancel_delayed_work_sync(&hdcp_work[i].watchdog_timer_dwork);
} }
sysfs_remove_bin_file(kobj, &hdcp_work[0].attr);
kfree(hdcp_work->srm); kfree(hdcp_work->srm);
kfree(hdcp_work->srm_temp); kfree(hdcp_work->srm_temp);
kfree(hdcp_work); kfree(hdcp_work);
......
...@@ -69,7 +69,7 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work, ...@@ -69,7 +69,7 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
void hdcp_reset_display(struct hdcp_workqueue *work, unsigned int link_index); void hdcp_reset_display(struct hdcp_workqueue *work, unsigned int link_index);
void hdcp_handle_cpirq(struct hdcp_workqueue *work, unsigned int link_index); void hdcp_handle_cpirq(struct hdcp_workqueue *work, unsigned int link_index);
void hdcp_destroy(struct hdcp_workqueue *work); void hdcp_destroy(struct kobject *kobj, struct hdcp_workqueue *work);
struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct cp_psp *cp_psp, struct dc *dc); struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct cp_psp *cp_psp, struct dc *dc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment