From patchwork Thu Aug 4 15:33:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Oberritter X-Patchwork-Id: 1036132 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p74FeoL5000397 for ; Thu, 4 Aug 2011 15:40:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754147Ab1HDPkn (ORCPT ); Thu, 4 Aug 2011 11:40:43 -0400 Received: from mail.dream-property.net ([82.149.226.172]:36442 "EHLO mail.dream-property.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753883Ab1HDPkm (ORCPT ); Thu, 4 Aug 2011 11:40:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.dream-property.net (Postfix) with ESMTP id 288E3315347A for ; Thu, 4 Aug 2011 17:33:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.dream-property.net Received: from mail.dream-property.net ([127.0.0.1]) by localhost (mail.dream-property.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ouKQqh6kKDZM for ; Thu, 4 Aug 2011 17:33:17 +0200 (CEST) Received: from pepe.dream-property.nete (dreamboxupdate.com [82.149.226.174]) by mail.dream-property.net (Postfix) with SMTP id 0FA6A3153473 for ; Thu, 4 Aug 2011 17:33:16 +0200 (CEST) Received: by pepe.dream-property.nete (sSMTP sendmail emulation); Thu, 04 Aug 2011 15:33:15 +0000 From: Andreas Oberritter To: linux-media@vger.kernel.org Subject: [PATCH 1/4] DVB: dvb_frontend: fix stale parameters on initial frontend event Date: Thu, 4 Aug 2011 15:33:12 +0000 Message-Id: <1312471995-26292-1-git-send-email-obi@linuxtv.org> X-Mailer: git-send-email 1.7.2.5 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 (demeter2.kernel.org [140.211.167.43]); Thu, 04 Aug 2011 15:40:51 +0000 (UTC) - FE_SET_FRONTEND triggers a frontend event, which uses stale data. Modify it to use the data given by the user. - Fixes a regression caused by a5959dbea37973a2440eeba39fba32c79d862ec2. Signed-off-by: Andreas Oberritter --- drivers/media/dvb/dvb-core/dvb_frontend.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index efe9c30..23d79d0 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -1827,6 +1827,13 @@ static int dvb_frontend_ioctl_legacy(struct file *file, dtv_property_cache_sync(fe, c, &fepriv->parameters_in); } + /* + * Initialize output parameters to match the values given by + * the user. FE_SET_FRONTEND triggers an initial frontend event + * with status = 0, which copies output parameters to userspace. + */ + fepriv->parameters_out = fepriv->parameters_in; + memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings)); memcpy(&fetunesettings.parameters, parg, sizeof (struct dvb_frontend_parameters));