]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: exynos-gsc: fix return code if mutex was interrupted
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 7 Aug 2018 13:15:27 +0000 (09:15 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 8 Aug 2018 14:57:14 +0000 (10:57 -0400)
All poll routines expect a poll flag, and not error codes. So,
instead of returning -ERESTARTSYS if the mutex got interrupted,
return EPOLERR, just like the V4L2 VB2 code.

Solves this sparce warning:
drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: warning: incorrect type in return expression (different base types)
drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24:    expected restricted __poll_t
drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24:    got int

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/exynos-gsc/gsc-m2m.c

index e9ff27949a91adbd8cb36c2ef3fe33d6a5b8aa77..c9d2f6c5311a73fd284fe7d7c32d71ba44c844b8 100644 (file)
@@ -713,7 +713,7 @@ static __poll_t gsc_m2m_poll(struct file *file,
        __poll_t ret;
 
        if (mutex_lock_interruptible(&gsc->lock))
-               return -ERESTARTSYS;
+               return EPOLLERR;
 
        ret = v4l2_m2m_poll(file, ctx->m2m_ctx, wait);
        mutex_unlock(&gsc->lock);