From patchwork Fri Jan 4 20:59:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 1934811 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 894AB40B29 for ; Fri, 4 Jan 2013 21:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755244Ab3ADVAr (ORCPT ); Fri, 4 Jan 2013 16:00:47 -0500 Received: from mail-vc0-f179.google.com ([209.85.220.179]:62407 "EHLO mail-vc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755041Ab3ADVAC (ORCPT ); Fri, 4 Jan 2013 16:00:02 -0500 Received: by mail-vc0-f179.google.com with SMTP id p1so16676881vcq.24 for ; Fri, 04 Jan 2013 13:00:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=yR2ZgzgQBiom51okeea0g2vbiye3RpcBgK4iTmIdON0=; b=Ao/QHlXwDt+ekhOMHtPZ9XcrQ/buQgHyQm2GKQ31oa9ihFdScMUs9nWiq00l5uvWSf GzWQv3/1e2B+Pzc06escHwBUaFPPzlFAbmxtdPhvSAK9ajHsrROZ7JaDgYJ3lWD3i8gQ 8+S7W9e47AFKYt9SlQ3GJQidK5Osnj8A/QHqZmzpOX+SR3Dq89F0CwrONtEdpO57XtnC XuYvc7fRLqC336Q8MBvYKljYW9n4XvqirlK4F/8STasyHJEhPDC0y00rb/oIz0h+T+NC I5dPMnoQDEzsu0w73xIFiOx79C3MS12Sfa2gDwxtux4kuzNLMSbmRjWpxy5zct9zbszz I+kw== X-Received: by 10.58.221.130 with SMTP id qe2mr80480862vec.14.1357333201320; Fri, 04 Jan 2013 13:00:01 -0800 (PST) Received: from devin-ubuntu2.home (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id z20sm47278440vds.12.2013.01.04.13.00.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 13:00:00 -0800 (PST) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller , Hans Verkuil Subject: [PATCH 09/15] em28xx: fill in readbuffers and fix incorrect return code. Date: Fri, 4 Jan 2013 15:59:39 -0500 Message-Id: <1357333186-8466-10-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357333186-8466-1-git-send-email-dheitmueller@kernellabs.com> References: <1357333186-8466-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQk50K2NOT/3JPi4b7nE5S61FfwPeIYUMqAYK2VXS8bL179AerUsEwOeEQZJtIiMFTUG2Fit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org g/s_parm should fill in readbuffers. For non-webcams s_parm should return -ENOTTY instead of -EINVAL. Signed-off-by: Hans Verkuil Signed-off-by: Devin Heitmueller --- drivers/media/usb/em28xx/em28xx-video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index acdb434..a91a248 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -972,6 +972,7 @@ static int vidioc_g_parm(struct file *file, void *priv, if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; + p->parm.capture.readbuffers = EM28XX_MIN_BUF; if (dev->board.is_webcam) rc = v4l2_device_call_until_err(&dev->v4l2_dev, 0, video, g_parm, p); @@ -989,11 +990,12 @@ static int vidioc_s_parm(struct file *file, void *priv, struct em28xx *dev = fh->dev; if (!dev->board.is_webcam) - return -EINVAL; + return -ENOTTY; if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; + p->parm.capture.readbuffers = EM28XX_MIN_BUF; return v4l2_device_call_until_err(&dev->v4l2_dev, 0, video, s_parm, p); }