summaryrefslogtreecommitdiff
path: root/drivers/media/cec/core/cec-adap.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2023-06-12 15:58:38 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-08-10 07:58:32 +0200
commit948a77aaecf202f722cf2264025f9987e5bd5c26 (patch)
tree66f504321215e134c8f75322cbf3a9596ab810cc /drivers/media/cec/core/cec-adap.c
parentda53c36ddd3f118a525a04faa8c47ca471e6c467 (diff)
media: cec: core: add adap_unconfigured() callback
The adap_configured() callback was called with the adap->lock mutex held if the 'configured' argument was false, and without the adap->lock mutex held if that argument was true. That was very confusing, and so split this up in a adap_unconfigured() callback and a high-level configured() callback. This also makes it easier to understand when the mutex is held: all low-level adap_* callbacks are called with the mutex held. All other callbacks are called without that mutex held. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: f1b57164305d ("media: cec: add optional adap_configured callback") Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/cec/core/cec-adap.c')
-rw-r--r--drivers/media/cec/core/cec-adap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c
index a9b73fb33888..09ca83c23329 100644
--- a/drivers/media/cec/core/cec-adap.c
+++ b/drivers/media/cec/core/cec-adap.c
@@ -1348,7 +1348,7 @@ static void cec_adap_unconfigure(struct cec_adapter *adap)
cec_flush(adap);
wake_up_interruptible(&adap->kthread_waitq);
cec_post_state_event(adap);
- call_void_op(adap, adap_configured, false);
+ call_void_op(adap, adap_unconfigured);
}
/*
@@ -1539,7 +1539,7 @@ configured:
adap->kthread_config = NULL;
complete(&adap->config_completion);
mutex_unlock(&adap->lock);
- call_void_op(adap, adap_configured, true);
+ call_void_op(adap, configured);
return 0;
unconfigure: