From patchwork Mon Aug 27 07:23:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanlong Gao X-Patchwork-Id: 1376551 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7B15440D06 for ; Mon, 27 Aug 2012 07:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752968Ab2H0HZ3 (ORCPT ); Mon, 27 Aug 2012 03:25:29 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:54657 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752826Ab2H0HZ0 (ORCPT ); Mon, 27 Aug 2012 03:25:26 -0400 X-IronPort-AV: E=Sophos;i="4.77,833,1336320000"; d="scan'208";a="5730524" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 27 Aug 2012 15:24:15 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id q7R7PMdM007486; Mon, 27 Aug 2012 15:25:23 +0800 Received: from gaowanlong.fnst.cn.fujitsu.com ([10.167.225.197]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012082715251500-507514 ; Mon, 27 Aug 2012 15:25:15 +0800 From: Wanlong Gao To: linux-kernel@vger.kernel.org Cc: Wanlong Gao , Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 4/5] video:omap3isp:fix up ENOIOCTLCMD error handling Date: Mon, 27 Aug 2012 15:23:15 +0800 Message-Id: <1346052196-32682-5-git-send-email-gaowanlong@cn.fujitsu.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1346052196-32682-1-git-send-email-gaowanlong@cn.fujitsu.com> References: <1346052196-32682-1-git-send-email-gaowanlong@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/27 15:25:15, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/27 15:25:15, Serialize complete at 2012/08/27 15:25:15 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be translated as ENOTTY to user mode. Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Wanlong Gao --- drivers/media/video/omap3isp/ispvideo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c index b37379d..2dd982e 100644 --- a/drivers/media/video/omap3isp/ispvideo.c +++ b/drivers/media/video/omap3isp/ispvideo.c @@ -337,7 +337,7 @@ __isp_video_get_format(struct isp_video *video, struct v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); if (ret == -ENOIOCTLCMD) - ret = -EINVAL; + ret = -ENOTTY; mutex_unlock(&video->mutex); @@ -723,7 +723,7 @@ isp_video_try_format(struct file *file, void *fh, struct v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); if (ret) - return ret == -ENOIOCTLCMD ? -EINVAL : ret; + return ret == -ENOIOCTLCMD ? -ENOTTY : ret; isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix); return 0; @@ -744,7 +744,7 @@ isp_video_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropcap) ret = v4l2_subdev_call(subdev, video, cropcap, cropcap); mutex_unlock(&video->mutex); - return ret == -ENOIOCTLCMD ? -EINVAL : ret; + return ret == -ENOIOCTLCMD ? -ENOTTY : ret; } static int @@ -771,7 +771,7 @@ isp_video_get_crop(struct file *file, void *fh, struct v4l2_crop *crop) format.which = V4L2_SUBDEV_FORMAT_ACTIVE; ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &format); if (ret < 0) - return ret == -ENOIOCTLCMD ? -EINVAL : ret; + return ret == -ENOIOCTLCMD ? -ENOTTY : ret; crop->c.left = 0; crop->c.top = 0; @@ -796,7 +796,7 @@ isp_video_set_crop(struct file *file, void *fh, struct v4l2_crop *crop) ret = v4l2_subdev_call(subdev, video, s_crop, crop); mutex_unlock(&video->mutex); - return ret == -ENOIOCTLCMD ? -EINVAL : ret; + return ret == -ENOIOCTLCMD ? -ENOTTY : ret; } static int