Commit a694f1b2 authored by Wanlong Gao's avatar Wanlong Gao Committed by Mauro Carvalho Chehab

[media] omap3isp: Fix up ENOIOCTLCMD error handling

At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
translated as ENOTTY to user mode.
Signed-off-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 254ee2e0
...@@ -733,7 +733,7 @@ isp_video_try_format(struct file *file, void *fh, struct v4l2_format *format) ...@@ -733,7 +733,7 @@ isp_video_try_format(struct file *file, void *fh, struct v4l2_format *format)
fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
if (ret) if (ret)
return ret == -ENOIOCTLCMD ? -EINVAL : ret; return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix); isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix);
return 0; return 0;
...@@ -754,7 +754,7 @@ isp_video_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropcap) ...@@ -754,7 +754,7 @@ isp_video_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropcap)
ret = v4l2_subdev_call(subdev, video, cropcap, cropcap); ret = v4l2_subdev_call(subdev, video, cropcap, cropcap);
mutex_unlock(&video->mutex); mutex_unlock(&video->mutex);
return ret == -ENOIOCTLCMD ? -EINVAL : ret; return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
} }
static int static int
...@@ -781,7 +781,7 @@ isp_video_get_crop(struct file *file, void *fh, struct v4l2_crop *crop) ...@@ -781,7 +781,7 @@ isp_video_get_crop(struct file *file, void *fh, struct v4l2_crop *crop)
format.which = V4L2_SUBDEV_FORMAT_ACTIVE; format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &format); ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &format);
if (ret < 0) if (ret < 0)
return ret == -ENOIOCTLCMD ? -EINVAL : ret; return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
crop->c.left = 0; crop->c.left = 0;
crop->c.top = 0; crop->c.top = 0;
...@@ -806,7 +806,7 @@ isp_video_set_crop(struct file *file, void *fh, struct v4l2_crop *crop) ...@@ -806,7 +806,7 @@ isp_video_set_crop(struct file *file, void *fh, struct v4l2_crop *crop)
ret = v4l2_subdev_call(subdev, video, s_crop, crop); ret = v4l2_subdev_call(subdev, video, s_crop, crop);
mutex_unlock(&video->mutex); mutex_unlock(&video->mutex);
return ret == -ENOIOCTLCMD ? -EINVAL : ret; return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment