]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: s3c-camif: fix return code for the polling routine
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 7 Aug 2018 13:23:33 +0000 (09:23 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 8 Aug 2018 14:57:14 +0000 (10:57 -0400)
All poll handlers should return a poll flag, and not error codes. So,
instead of returning an error, do the right thing here,
e. g. to return EPOLERR on errors, just like the V4L2 VB2 code.

Solves the following sparse warning:
    drivers/media/platform/s3c-camif/camif-capture.c:604:21: warning: incorrect type in assignment (different base types)
    drivers/media/platform/s3c-camif/camif-capture.c:604:21:    expected restricted __poll_t [usertype] ret
    drivers/media/platform/s3c-camif/camif-capture.c:604:21:    got int

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/s3c-camif/camif-capture.c

index b1d9f3857d3d39ba119a9c76136c276e6c027fa7..c02dce8b4c6c788ba5dd025fc35b1378a9c466e9 100644 (file)
@@ -601,7 +601,7 @@ static __poll_t s3c_camif_poll(struct file *file,
 
        mutex_lock(&camif->lock);
        if (vp->owner && vp->owner != file->private_data)
-               ret = -EBUSY;
+               ret = EPOLLERR;
        else
                ret = vb2_poll(&vp->vb_queue, file, wait);