From patchwork Wed Apr 17 00:42:21 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: 2451721 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 E24643FD8C for ; Wed, 17 Apr 2013 00:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754885Ab3DQAmt (ORCPT ); Tue, 16 Apr 2013 20:42:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754659Ab3DQAms (ORCPT ); Tue, 16 Apr 2013 20:42:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3H0gmuE031237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 20:42:48 -0400 Received: from pedra (vpn1-7-94.gru2.redhat.com [10.97.7.94]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3H0gkYi005529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Apr 2013 20:42:47 -0400 Received: from v4l by pedra with local (Exim 4.80.1) (envelope-from ) id 1USGST-0001HO-8d; Tue, 16 Apr 2013 21:42:45 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH v2 10/31] [media] r820t: use the right IF for the selected TV standard Date: Tue, 16 Apr 2013 21:42:21 -0300 Message-Id: <1366159362-3773-11-git-send-email-mchehab@redhat.com> In-Reply-To: <1366159362-3773-1-git-send-email-mchehab@redhat.com> References: <1366159362-3773-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 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 is set at r820t_set_tv_standard(). So, we can't calculate LO frequency before calling it. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/r820t.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c index 2ecf1d2..48ff6bb 100644 --- a/drivers/media/tuners/r820t.c +++ b/drivers/media/tuners/r820t.c @@ -1193,15 +1193,15 @@ static int generic_set_freq(struct dvb_frontend *fe, tuner_dbg("should set frequency to %d kHz, bw %d MHz\n", freq / 1000, bw); + rc = r820t_set_tv_standard(priv, bw, type, std, delsys); + if (rc < 0) + goto err; + if ((type == V4L2_TUNER_ANALOG_TV) && (std == V4L2_STD_SECAM_LC)) lo_freq = freq - priv->int_freq; else lo_freq = freq + priv->int_freq; - rc = r820t_set_tv_standard(priv, bw, type, std, delsys); - if (rc < 0) - goto err; - rc = r820t_set_mux(priv, lo_freq); if (rc < 0) goto err;