From patchwork Tue Jan 22 11:15:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 2017791 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 0EEB53FCDE for ; Tue, 22 Jan 2013 11:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667Ab3AVLQK (ORCPT ); Tue, 22 Jan 2013 06:16:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50544 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751635Ab3AVLQJ (ORCPT ); Tue, 22 Jan 2013 06:16:09 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0MBG98d000526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 22 Jan 2013 06:16:09 -0500 Received: from pedra (vpn1-7-105.gru2.redhat.com [10.97.7.105]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0MBG71t022720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jan 2013 06:16:08 -0500 Received: from v4l by pedra with local (Exim 4.76) (envelope-from ) id 1TxbpH-0005de-1c; Tue, 22 Jan 2013 09:15:35 -0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH 2/7] [media] mb86a20s: Fix i2c gate on error Date: Tue, 22 Jan 2013 09:15:28 -0200 Message-Id: <1358853333-21554-2-git-send-email-mchehab@redhat.com> In-Reply-To: <1358853333-21554-1-git-send-email-mchehab@redhat.com> References: <1358853333-21554-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If an error happens, restore tuner I2C gate to the right value. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/mb86a20s.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 4ff3a0c..3c8587e 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -262,10 +262,10 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) goto err; } +err: if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); -err: if (rc < 0) { state->need_init = true; printk(KERN_INFO "mb86a20s: Init failed. Will try again later\n"); @@ -363,6 +363,10 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe) dprintk("\n"); + /* + * Gate should already be opened, but it doesn't hurt to + * double-check + */ if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); dprintk("Calling tuner set parameters\n");