From patchwork Thu Dec 16 19:00:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 5103 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Thu, 16 Dec 2010 17:58:40 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PTJyJ-0006Jx-Mo for mchehab@gaivota; Thu, 16 Dec 2010 17:58:40 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 16 Dec 2010 17:58:39 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PTJ4z-0003U1-QE; Thu, 16 Dec 2010 19:01:30 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757336Ab0LPTBG (ORCPT + 1 other); Thu, 16 Dec 2010 14:01:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54538 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757309Ab0LPTBB (ORCPT ); Thu, 16 Dec 2010 14:01:01 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBGJ1080030146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Dec 2010 14:01:00 -0500 Received: from xavier.bos.redhat.com (xavier.bos.redhat.com [10.16.16.50]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBGJ0m7A013343; Thu, 16 Dec 2010 14:01:00 -0500 From: Jarod Wilson To: linux-media@vger.kernel.org Cc: Jarod Wilson Subject: [PATCH 2/4] mceusb: set a default rx timeout Date: Thu, 16 Dec 2010 14:00:35 -0500 Message-Id: <1292526037-21491-3-git-send-email-jarod@redhat.com> In-Reply-To: <1292526037-21491-1-git-send-email-jarod@redhat.com> References: <1292526037-21491-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab Its possible for the call to read rx timeout from the hardware to fail, in which case we end up with a bogus rx timeout value. Set a default one when filling in the rc struct, and we'll just overwrite it later w/the value from hardware, but if that read fails, we've at least got a sane rx timeout value to work with (1000ms is the default value I've seen returned on most if not all mceusb hardware). Signed-off-by: Jarod Wilson --- drivers/media/rc/mceusb.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 0739dee..94b95d4 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1059,6 +1059,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) rc->priv = ir; rc->driver_type = RC_DRIVER_IR_RAW; rc->allowed_protos = RC_TYPE_ALL; + rc->timeout = MS_TO_NS(1000); if (!ir->flags.no_tx) { rc->s_tx_mask = mceusb_set_tx_mask; rc->s_tx_carrier = mceusb_set_tx_carrier;