From: Sheng Nan Date: Wed, 19 Dec 2012 09:27:42 +0000 (+0800) Subject: ENGR00237706: mxc_v4l2_capture: ov5640: correct the behavior of ENUM_FMT X-Git-Tag: v3.0.35-fsl~160 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c91ff453e282d91b2cf7acf349e84714f27b4990;p=karo-tx-linux.git ENGR00237706: mxc_v4l2_capture: ov5640: correct the behavior of ENUM_FMT ov5640 ioctl_enum_fmt_cap only returns value of index = 0; before support other formats, correct the behavior of this ioctl. - ENUM_FMT returns all the supported format. Signed-off-by: Sheng Nan --- diff --git a/drivers/media/video/mxc/capture/ov5640.c b/drivers/media/video/mxc/capture/ov5640.c index 813fd8003bbf..c816833ecfa4 100644 --- a/drivers/media/video/mxc/capture/ov5640.c +++ b/drivers/media/video/mxc/capture/ov5640.c @@ -829,7 +829,7 @@ static int ioctl_init(struct v4l2_int_device *s) static int ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt) { - if (fmt->index > 0) /* only 1 pixelformat support so far */ + if (fmt->index > ov5640_mode_MAX) return -EINVAL; fmt->pixelformat = ov5640_data.pix.pixelformat;