From patchwork Thu Sep 27 15:16:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1514851 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 C50CF3FC71 for ; Thu, 27 Sep 2012 15:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755086Ab2I0PPz (ORCPT ); Thu, 27 Sep 2012 11:15:55 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:60156 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754966Ab2I0PPw (ORCPT ); Thu, 27 Sep 2012 11:15:52 -0400 Received: from avalon.ideasonboard.com (unknown [91.178.154.29]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A645235A8E; Thu, 27 Sep 2012 17:15:50 +0200 (CEST) From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [PATCH 5/6] uvcvideo: Return -ENOTTY for unsupported ioctls Date: Thu, 27 Sep 2012 17:16:19 +0200 Message-Id: <1348758980-21683-6-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1348758980-21683-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1348758980-21683-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The proper error code is -ENOTTY instead of -EINVAL. This issue was found by the v4l2-compliance tool. Signed-off-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_v4l2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index b1aa55f..bf9d073 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -932,7 +932,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) case VIDIOC_G_CROP: case VIDIOC_S_CROP: - return -EINVAL; + return -ENOTTY; /* Buffers & streaming */ case VIDIOC_REQBUFS: @@ -1038,7 +1038,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) case VIDIOC_ENUMOUTPUT: uvc_trace(UVC_TRACE_IOCTL, "Unsupported ioctl 0x%08x\n", cmd); - return -EINVAL; + return -ENOTTY; case UVCIOC_CTRL_MAP: return uvc_ioctl_ctrl_map(chain, arg);