]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] cec: CEC_RECEIVE is allowed in monitor mode
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 11 Jul 2016 08:48:10 +0000 (05:48 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 12 Jul 2016 16:40:06 +0000 (13:40 -0300)
When the device is in monitor mode, then you should always be able to
call CEC_RECEIVE, even it the device is unconfigured.

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

index d7cba7a7d6b093174fd1fd7d0867727a8e1e2ccd..9151b1fa18dc78e23a977c0c67a21f30fdcac506 100644 (file)
@@ -263,7 +263,7 @@ static long cec_receive(struct cec_adapter *adap, struct cec_fh *fh,
        if (copy_from_user(&msg, parg, sizeof(msg)))
                return -EFAULT;
        mutex_lock(&adap->lock);
-       if (!adap->is_configured)
+       if (!adap->is_configured && fh->mode_follower < CEC_MODE_MONITOR)
                err = -ENONET;
        mutex_unlock(&adap->lock);
        if (err)