From patchwork Thu Sep 20 01:05:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 1481891 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 23C893FE65 for ; Thu, 20 Sep 2012 01:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751153Ab2ITBGG (ORCPT ); Wed, 19 Sep 2012 21:06:06 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:45969 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852Ab2ITBGF (ORCPT ); Wed, 19 Sep 2012 21:06:05 -0400 Received: from dyn3-82-128-186-237.psoas.suomi.net ([82.128.186.237] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TEVDO-0003Yl-M7; Thu, 20 Sep 2012 04:06:02 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 1/3] em28xx: do not set PCTV 290e LNA handler if fe attach fail Date: Thu, 20 Sep 2012 04:05:28 +0300 Message-Id: <1348103130-1777-1-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.7.11.4 X-SA-Exim-Connect-IP: 82.128.186.237 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org It was a bug that could cause oops if demodulator attach was failed. Signed-off-by: Antti Palosaari --- drivers/media/usb/em28xx/em28xx-dvb.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index e0128b3..be242ac 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1001,19 +1001,22 @@ static int em28xx_dvb_init(struct em28xx *dev) result = -EINVAL; goto out_free; } - } #ifdef CONFIG_GPIOLIB - /* enable LNA for DVB-T, DVB-T2 and DVB-C */ - result = gpio_request_one(dvb->gpio, GPIOF_OUT_INIT_LOW, NULL); - if (result) - em28xx_errdev("gpio request failed %d\n", result); - else - gpio_free(dvb->gpio); - - result = 0; /* continue even set LNA fails */ + /* enable LNA for DVB-T, DVB-T2 and DVB-C */ + result = gpio_request_one(dvb->gpio, + GPIOF_OUT_INIT_LOW, NULL); + if (result) + em28xx_errdev("gpio request failed %d\n", + result); + else + gpio_free(dvb->gpio); + + result = 0; /* continue even set LNA fails */ #endif - dvb->fe[0]->ops.set_lna = em28xx_pctv_290e_set_lna; + dvb->fe[0]->ops.set_lna = em28xx_pctv_290e_set_lna; + } + break; case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C: {