From patchwork Tue Aug 7 02:47:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 1282671 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 E44303FC8A for ; Tue, 7 Aug 2012 02:48:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932573Ab2HGCsE (ORCPT ); Mon, 6 Aug 2012 22:48:04 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:52727 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932526Ab2HGCsC (ORCPT ); Mon, 6 Aug 2012 22:48:02 -0400 Received: by mail-vc0-f174.google.com with SMTP id fk26so3432709vcb.19 for ; Mon, 06 Aug 2012 19:48:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=C13H0ElNcTEbPIoHUlONfYZGkKt2C4mI362lpjWQ83I=; b=T9l+FO6U4vfTR7EzOgNw4AVAKFPw2MU24kySRs1ScU/imN5dgm3vl5lLHzt/mjb58+ bu5ZCnDYpIuqDuVNmiaPhMfn47GYKXyV3wFptpJa1G3CgT1LQCPyEsgOPcq1/1Wy3Gqz brzeR3GKqrTRDe6leSdPofUwvI2lLLgjs75q4JcrEC8JjpG5gm0US3/h+WbgnPwcD4xe y+45MWwytFcPuk8GOhVBdliiUZplrY9y3d0bi4M95kxeWMj/khBPJawYj8y5IcCF5n9T ud52nBPiMivcrYuNzfHTmcRK3mv+UihVxaA9N7wG4d6Ntyg90lw9Z9miFlZfmjktJk2Y KZGw== Received: by 10.52.93.98 with SMTP id ct2mr8403036vdb.97.1344307681766; Mon, 06 Aug 2012 19:48:01 -0700 (PDT) Received: from localhost.localdomain (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id e9sm17555638vdf.21.2012.08.06.19.48.00 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 19:48:01 -0700 (PDT) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller Subject: [PATCH 15/24] au0828: remove control buffer from send_control_msg Date: Mon, 6 Aug 2012 22:47:05 -0400 Message-Id: <1344307634-11673-16-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> References: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQntdQzRtNGUNrOhYEl8uoyNuBQdLGAc1mnSvtDan3tWeDZS6nxBnh0Vcs9qYM2mwv/JjAHS Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org There are no cases where a control message is ever sent to the au0828 with an actual buffer defined. Remove the reference to dev->ctrlmsg, which currently requires us to hold a mutex since it is shared with the read function. Signed-off-by: Devin Heitmueller --- drivers/media/video/au0828/au0828-core.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c index b2c4254..65914bc 100644 --- a/drivers/media/video/au0828/au0828-core.c +++ b/drivers/media/video/au0828/au0828-core.c @@ -46,7 +46,7 @@ MODULE_PARM_DESC(disable_usb_speed_check, #define _BULKPIPESIZE 0xffff static int send_control_msg(struct au0828_dev *dev, u16 request, u32 value, - u16 index, unsigned char *cp, u16 size); + u16 index); static int recv_control_msg(struct au0828_dev *dev, u16 request, u32 value, u16 index, unsigned char *cp, u16 size); @@ -64,8 +64,7 @@ u32 au0828_readreg(struct au0828_dev *dev, u16 reg) u32 au0828_writereg(struct au0828_dev *dev, u16 reg, u32 val) { dprintk(8, "%s(0x%04x, 0x%02x)\n", __func__, reg, val); - return send_control_msg(dev, CMD_REQUEST_OUT, val, reg, - dev->ctrlmsg, 0); + return send_control_msg(dev, CMD_REQUEST_OUT, val, reg); } static void cmd_msg_dump(struct au0828_dev *dev) @@ -87,10 +86,10 @@ static void cmd_msg_dump(struct au0828_dev *dev) } static int send_control_msg(struct au0828_dev *dev, u16 request, u32 value, - u16 index, unsigned char *cp, u16 size) + u16 index) { int status = -ENODEV; - mutex_lock(&dev->mutex); + if (dev->usbdev) { /* cp must be memory that has been allocated by kmalloc */ @@ -99,8 +98,7 @@ static int send_control_msg(struct au0828_dev *dev, u16 request, u32 value, request, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - value, index, - cp, size, 1000); + value, index, NULL, 0, 1000); status = min(status, 0); @@ -110,7 +108,7 @@ static int send_control_msg(struct au0828_dev *dev, u16 request, u32 value, } } - mutex_unlock(&dev->mutex); + return status; }