mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
disp: msm: dp: add operation to free the mst port object
Add a release operation to free the mst port object when the object refcount becomes zero. Change-Id: If628e6da7ccf90d334574ed0f627788fb0a1fa2f Signed-off-by: Samantha Tran <samtran@codeaurora.org>
This commit is contained in:
parent
e6933ff2dc
commit
d76c3a72ec
1 changed files with 9 additions and 1 deletions
|
|
@ -152,6 +152,13 @@ struct dp_mst_encoder_info_cache {
|
|||
struct dp_mst_private dp_mst;
|
||||
struct dp_mst_encoder_info_cache dp_mst_enc_cache;
|
||||
|
||||
static void dp_mst_sim_destroy_port(struct kref *ref)
|
||||
{
|
||||
struct drm_dp_mst_port *port = container_of(ref,
|
||||
struct drm_dp_mst_port, kref);
|
||||
kfree(port);
|
||||
}
|
||||
|
||||
/* DRM DP MST Framework simulator OPs */
|
||||
static void dp_mst_sim_add_port(struct dp_mst_private *mst,
|
||||
struct dp_mst_sim_port_data *port_msg)
|
||||
|
|
@ -196,13 +203,14 @@ static void dp_mst_sim_add_port(struct dp_mst_private *mst,
|
|||
mutex_lock(&mstb->mgr->lock);
|
||||
list_del(&port->next);
|
||||
mutex_unlock(&mstb->mgr->lock);
|
||||
kref_put(&port->kref, dp_mst_sim_destroy_port);
|
||||
goto put_port;
|
||||
}
|
||||
(*mstb->mgr->cbs->register_connector)(port->connector);
|
||||
}
|
||||
|
||||
put_port:
|
||||
kref_put(&port->kref, NULL);
|
||||
kref_put(&port->kref, dp_mst_sim_destroy_port);
|
||||
}
|
||||
|
||||
static void dp_mst_sim_link_probe_work(struct work_struct *work)
|
||||
|
|
|
|||
Loading…
Reference in a new issue