From patchwork Wed Jul 20 17:03:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 9240015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 044D360574 for ; Wed, 20 Jul 2016 17:04:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E014F27D5E for ; Wed, 20 Jul 2016 17:04:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D432927DB3; Wed, 20 Jul 2016 17:04:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7EAA27D5E for ; Wed, 20 Jul 2016 17:04:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754773AbcGTREF (ORCPT ); Wed, 20 Jul 2016 13:04:05 -0400 Received: from gofer.mess.org ([80.229.237.210]:57771 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753969AbcGTRDx (ORCPT ); Wed, 20 Jul 2016 13:03:53 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 2C55561C5F; Wed, 20 Jul 2016 18:03:50 +0100 (BST) From: Sean Young To: Mauro Carvalho Chehab Cc: Chris Dodge , linux-media@vger.kernel.org Subject: [PATCH 1/2] [media] redrat3: remove hw_timeout member Date: Wed, 20 Jul 2016 18:03:49 +0100 Message-Id: <1469034230-19978-1-git-send-email-sean@mess.org> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a duplicate of the timeout in rc_dev. Signed-off-by: Sean Young --- drivers/media/rc/redrat3.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 399f44d..4739bce 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -188,9 +188,6 @@ struct redrat3_dev { /* usb dma */ dma_addr_t dma_in; - /* rx signal timeout */ - u32 hw_timeout; - /* Is the device currently transmitting?*/ bool transmitting; @@ -372,7 +369,7 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3) /* add a trailing space */ rawir.pulse = false; rawir.timeout = true; - rawir.duration = US_TO_NS(rr3->hw_timeout); + rawir.duration = rr3->rc->timeout; dev_dbg(dev, "storing trailing timeout with duration %d\n", rawir.duration); ir_raw_event_store_with_filter(rr3->rc, &rawir); @@ -495,10 +492,9 @@ static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutns) dev_dbg(dev, "set ir parm timeout %d ret 0x%02x\n", be32_to_cpu(*timeout), ret); - if (ret == sizeof(*timeout)) { - rr3->hw_timeout = timeoutns / 1000; + if (ret == sizeof(*timeout)) ret = 0; - } else if (ret >= 0) + else if (ret >= 0) ret = -EIO; kfree(timeout); @@ -889,7 +885,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3) rc->allowed_protocols = RC_BIT_ALL; rc->min_timeout = MS_TO_NS(RR3_RX_MIN_TIMEOUT); rc->max_timeout = MS_TO_NS(RR3_RX_MAX_TIMEOUT); - rc->timeout = US_TO_NS(rr3->hw_timeout); + rc->timeout = US_TO_NS(redrat3_get_timeout(rr3)); rc->s_timeout = redrat3_set_timeout; rc->tx_ir = redrat3_transmit_ir; rc->s_tx_carrier = redrat3_set_tx_carrier; @@ -1000,9 +996,6 @@ static int redrat3_dev_probe(struct usb_interface *intf, if (retval < 0) goto error; - /* store current hardware timeout, in µs */ - rr3->hw_timeout = redrat3_get_timeout(rr3); - /* default.. will get overridden by any sends with a freq defined */ rr3->carrier = 38000;