Skip to content

Commit

Permalink
[media] davinci: vpif_capture: fix return type check for v4l2_subdev_…
Browse files Browse the repository at this point in the history
…call()

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 message]
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Wei Yongjun authored and Mauro Carvalho Chehab committed Nov 22, 2012
1 parent 864a121 commit e070f1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/platform/davinci/vpif_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,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;
}
Expand All @@ -1735,7 +1735,7 @@ vpif_query_dv_timings(struct file *file, void *priv,
int ret;

ret = v4l2_subdev_call(ch->sd, video, query_dv_timings, timings);
if (ret == -ENOIOCTLCMD && ret == -ENODEV)
if (ret == -ENOIOCTLCMD || ret == -ENODEV)
return -ENODATA;
return ret;
}
Expand Down

0 comments on commit e070f1b

Please sign in to comment.