Commit e6259b5f authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: cec: add adap_free op

This is needed for CEC adapters that allocate resources that have
to be freed before the cec_adapter is deleted.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 0861ad14
...@@ -374,6 +374,8 @@ void cec_delete_adapter(struct cec_adapter *adap) ...@@ -374,6 +374,8 @@ void cec_delete_adapter(struct cec_adapter *adap)
kthread_stop(adap->kthread); kthread_stop(adap->kthread);
if (adap->kthread_config) if (adap->kthread_config)
kthread_stop(adap->kthread_config); kthread_stop(adap->kthread_config);
if (adap->ops->adap_free)
adap->ops->adap_free(adap);
#ifdef CONFIG_MEDIA_CEC_RC #ifdef CONFIG_MEDIA_CEC_RC
rc_free_device(adap->rc); rc_free_device(adap->rc);
#endif #endif
......
...@@ -114,6 +114,7 @@ struct cec_adap_ops { ...@@ -114,6 +114,7 @@ struct cec_adap_ops {
int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
u32 signal_free_time, struct cec_msg *msg); u32 signal_free_time, struct cec_msg *msg);
void (*adap_status)(struct cec_adapter *adap, struct seq_file *file); void (*adap_status)(struct cec_adapter *adap, struct seq_file *file);
void (*adap_free)(struct cec_adapter *adap);
/* High-level CEC message callback */ /* High-level CEC message callback */
int (*received)(struct cec_adapter *adap, struct cec_msg *msg); int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
......
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