From patchwork Sun Feb 13 23:12:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 553551 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1DNCOdn017535 for ; Sun, 13 Feb 2011 23:12:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754831Ab1BMXMW (ORCPT ); Sun, 13 Feb 2011 18:12:22 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:62789 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753669Ab1BMXMV (ORCPT ); Sun, 13 Feb 2011 18:12:21 -0500 Received: by wyb28 with SMTP id 28so4190173wyb.19 for ; Sun, 13 Feb 2011 15:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=nCl+3xJreRGUxjrW4392iPJq7WM6vbuOMWSdU0QESiY=; b=JR9p2RE33V8P16anU8ANOS8jc1ht45zAwmF9pIBbFVj62zfFP/H9XzbOiK4qs6pj7P 47fPmNPLwJzfAc6EOBIuHmITbBBAO6FroKPlXJScP6GwAYaIfaN+10HLHmOaOVwf8e+O 1PGMEGVW3simKTpni/ydD1rZEtMY0EMSFNV/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=Q9LMzYq8s+hbdAGPolfM8arFlGmJfbG4BWoByBnMWGyZgcLU8jRo2Da2DHNUoz3NzP 171cLTjMmijmzO/Hqa0i4IUsjKhhXVbJQ1Uib6iP8EK398z9ZOxrIL4JrWuP+2dJBheL 4uaPdqYJgv0kpQIIXWCVjqCK+OO8TP7elY0Nc= Received: by 10.216.47.19 with SMTP id s19mr96332web.56.1297638740353; Sun, 13 Feb 2011 15:12:20 -0800 (PST) Received: from [10.64.64.65] (94.197.127.231.threembb.co.uk [94.197.127.231]) by mx.google.com with ESMTPS id u9sm1424266wbg.0.2011.02.13.15.12.18 (version=SSLv3 cipher=OTHER); Sun, 13 Feb 2011 15:12:19 -0800 (PST) Subject: [PATCH] DM04/QQBOX Fix issue with firmware release and cold reset From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Sun, 13 Feb 2011 23:12:15 +0000 Message-ID: <1297638735.5123.8.camel@tvboxspy> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 13 Feb 2011 23:12:25 +0000 (UTC) diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c index cd26e7c..ec0f5a7 100644 --- a/drivers/media/dvb/dvb-usb/lmedm04.c +++ b/drivers/media/dvb/dvb-usb/lmedm04.c @@ -747,7 +747,7 @@ static int lme_firmware_switch(struct usb_device *udev, int cold) fw_lme = fw_s0194; ret = request_firmware(&fw, fw_lme, &udev->dev); if (ret == 0) { - cold = 0;/*lme2510-s0194 cannot cold reset*/ + cold = 0; break; } dvb_usb_lme2510_firmware = TUNER_LG; @@ -769,8 +769,10 @@ static int lme_firmware_switch(struct usb_device *udev, int cold) case TUNER_S7395: fw_lme = fw_c_s7395; ret = request_firmware(&fw, fw_lme, &udev->dev); - if (ret == 0) + if (ret == 0) { + cold = 0; break; + } dvb_usb_lme2510_firmware = TUNER_LG; case TUNER_LG: fw_lme = fw_c_lg; @@ -796,14 +798,14 @@ static int lme_firmware_switch(struct usb_device *udev, int cold) ret = lme2510_download_firmware(udev, fw); } + release_firmware(fw); + if (cold) { info("FRM Changing to %s firmware", fw_lme); lme_coldreset(udev); return -ENODEV; } - release_firmware(fw); - return ret; } @@ -1220,5 +1222,5 @@ module_exit(lme2510_module_exit); MODULE_AUTHOR("Malcolm Priestley "); MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); -MODULE_VERSION("1.80"); +MODULE_VERSION("1.81"); MODULE_LICENSE("GPL");