[media] davinci: vpif_display: fix return type check for v4l2_subdev_call()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 30 Oct 2012 12:49:38 +0000 (09:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Nov 2012 14:20:13 +0000 (12:20 -0200)
The v4l2_subdev_call() call returns -ENODEV when subdev is
null and -ENOIOCTLCMD wnen no icotl is present.
This patch fixes the return type check for v4l2_subdev_call().
The pattern E == C1 && E == C2 is always false. This patch
fix this according to the assumption that && should be ||.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
[prabhakar.lad@ti.com: reword commit messaage]
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/davinci/vpif_display.c

index b716fbd4241f8599f90c8dbf7caf4b99e0f338bb..977ee436c334f8a8493eafc5e02389a13dea1bd6 100644 (file)
@@ -1380,7 +1380,7 @@ vpif_enum_dv_timings(struct file *file, void *priv,
        int ret;
 
        ret = v4l2_subdev_call(ch->sd, video, enum_dv_timings, timings);
-       if (ret == -ENOIOCTLCMD && ret == -ENODEV)
+       if (ret == -ENOIOCTLCMD || ret == -ENODEV)
                return -EINVAL;
        return ret;
 }