From patchwork Wed Jul 9 20:36:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 4519871 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40241BEEAA for ; Wed, 9 Jul 2014 20:36:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EA56201CE for ; Wed, 9 Jul 2014 20:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9112920145 for ; Wed, 9 Jul 2014 20:36:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbaGIUg1 (ORCPT ); Wed, 9 Jul 2014 16:36:27 -0400 Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:55248 "EHLO qmta06.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbaGIUg0 (ORCPT ); Wed, 9 Jul 2014 16:36:26 -0400 Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta06.emeryville.ca.mail.comcast.net with comcast id QLRZ1o0020S2fkCA6LcR1S; Wed, 09 Jul 2014 20:36:25 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta09.emeryville.ca.mail.comcast.net with comcast id QLcQ1o00F0MU7Qa8VLcQj5; Wed, 09 Jul 2014 20:36:25 +0000 Received: from lorien.sisa.samsung.com (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 247B73FD48; Wed, 9 Jul 2014 14:36:24 -0600 (MDT) From: Shuah Khan To: m.chehab@samsung.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: em28xx - add error handling for KWORLD dvb_attach failures Date: Wed, 9 Jul 2014 14:36:23 -0600 Message-Id: <1404938183-29535-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.9.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1404938185; bh=a4cp4Txm36EdrFqjAOfbv+MNYqq5KcBt1en699Pu4ig=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=F6PSDPFnobzz7u/3OeEZOblwGSZCqAj93bUWJo1xYGWI2LyBtcuo3/3o6+D/XHmt3 SmcWLcmIXmHtFR9j0Wb/TNApsL2/PeEVoZ6X0tuKVKLrT0SFRZGz8wahs+cDItGWk5 1+DrZtVHHn7wAM567G6XmCJ96fkCG/7ksxmpxBBgCgCUf+mLILde412TZgOj2ZdwB4 6kb+gw9l9UdTbHjcm1lz+WlhCaJUPjHPcuGhsooEilsxSWN0YdrnRXi/vSbrVzGJjG 3sYFvJgDdvcV9PJMDI2d6oCTPVl7aaNE8IUGbwYxAm8c5QUDsG/tWSSRy8LP25uFXT QqxtK6XvYuG4g== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add error hanlding when EM2870_BOARD_KWORLD_A340 dvb_attach() for fe and tuner fail in em28xx_dvb_init(). Signed-off-by: Shuah Khan Reviewed-by: Antti Palosaari --- drivers/media/usb/em28xx/em28xx-dvb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index d381861..8314f51 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1213,9 +1213,17 @@ static int em28xx_dvb_init(struct em28xx *dev) dvb->fe[0] = dvb_attach(lgdt3305_attach, &em2870_lgdt3304_dev, &dev->i2c_adap[dev->def_i2c_bus]); - if (dvb->fe[0] != NULL) - dvb_attach(tda18271_attach, dvb->fe[0], 0x60, - &dev->i2c_adap[dev->def_i2c_bus], &kworld_a340_config); + if (!dvb->fe[0]) { + result = -EINVAL; + goto out_free; + } + if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, + &dev->i2c_adap[dev->def_i2c_bus], + &kworld_a340_config)) { + dvb_frontend_detach(dvb->fe[0]); + result = -EINVAL; + goto out_free; + } break; case EM28174_BOARD_PCTV_290E: /* set default GPIO0 for LNA, used if GPIOLIB is undefined */