[media] cec: fix test for unconfigured adapter in main message loop
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 17 Jul 2016 14:42:06 +0000 (11:42 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 19 Jul 2016 16:26:06 +0000 (13:26 -0300)
The main message loop checks if the physical address was valid, and if
not it is assumed that the adapter had been unconfigured.

However, this check is no longer correct, instead it should check
that both adap->is_configured and adap->is_configuring are false.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/cec/cec-adap.c

index 159a89379959c47215dc3cb7a31bb0ffce136e36..6fa3db5121382e66ca80e1a088e5c901a6d1d490 100644 (file)
@@ -332,7 +332,7 @@ int cec_thread_func(void *_adap)
                         */
                        err = wait_event_interruptible_timeout(adap->kthread_waitq,
                                kthread_should_stop() ||
-                               adap->phys_addr == CEC_PHYS_ADDR_INVALID ||
+                               (!adap->is_configured && !adap->is_configuring) ||
                                (!adap->transmitting &&
                                 !list_empty(&adap->transmit_queue)),
                                msecs_to_jiffies(CEC_XFER_TIMEOUT_MS));
@@ -347,7 +347,7 @@ int cec_thread_func(void *_adap)
 
                mutex_lock(&adap->lock);
 
-               if (adap->phys_addr == CEC_PHYS_ADDR_INVALID ||
+               if ((!adap->is_configured && !adap->is_configuring) ||
                    kthread_should_stop()) {
                        /*
                         * If the adapter is disabled, or we're asked to stop,
This page took 0.027401 seconds and 5 git commands to generate.