From patchwork Sun May 8 23:03:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Oberritter X-Patchwork-Id: 6547 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Sun, 08 May 2011 23:27:22 -0300 Received: from mchehab by gaivota with local (Exim 4.73) (envelope-from ) id 1QJGBu-0001nr-Hh for mchehab@gaivota; Sun, 08 May 2011 23:27:22 -0300 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.19) for (single-drop); Sun, 08 May 2011 23:27:22 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1QJDAQ-0000lF-85; Sun, 08 May 2011 23:13:38 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756025Ab1EHXN0 (ORCPT + 1 other); Sun, 8 May 2011 19:13:26 -0400 Received: from mail.dream-property.net ([82.149.226.172]:52920 "EHLO mail.dream-property.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754184Ab1EHXNV (ORCPT ); Sun, 8 May 2011 19:13:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.dream-property.net (Postfix) with ESMTP id 360823150C7B; Mon, 9 May 2011 01:03:52 +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 Hj92QWBY-YTQ; Mon, 9 May 2011 01:03:46 +0200 (CEST) Received: from pepe.multimedia-labs.de (dreamboxupdate.com [82.149.226.174]) by mail.dream-property.net (Postfix) with SMTP id BD8A83150C7C; Mon, 9 May 2011 01:03:45 +0200 (CEST) Received: by pepe.multimedia-labs.de (sSMTP sendmail emulation); Sun, 08 May 2011 23:03:45 +0000 From: Andreas Oberritter To: linux-media@vger.kernel.org Cc: Thierry LELEGARD Subject: [PATCH 3/8] DVB: call get_property at the end of dtv_property_process_get Date: Sun, 8 May 2011 23:03:36 +0000 Message-Id: <1304895821-21642-4-git-send-email-obi@linuxtv.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1304895821-21642-1-git-send-email-obi@linuxtv.org> References: <1304895821-21642-1-git-send-email-obi@linuxtv.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab - Drivers should be able to override properties returned to the user. - The default values get prefilled from the cache. Signed-off-by: Andreas Oberritter --- drivers/media/dvb/dvb-core/dvb_frontend.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 1ac7633..bcb4186 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -1196,14 +1196,7 @@ static int dtv_property_process_get(struct dvb_frontend *fe, struct dtv_property *tvp, struct file *file) { - int r = 0; - - /* Allow the frontend to validate incoming properties */ - if (fe->ops.get_property) - r = fe->ops.get_property(fe, tvp); - - if (r < 0) - return r; + int r; switch(tvp->cmd) { case DTV_FREQUENCY: @@ -1323,6 +1316,13 @@ static int dtv_property_process_get(struct dvb_frontend *fe, return -EINVAL; } + /* Allow the frontend to override outgoing properties */ + if (fe->ops.get_property) { + r = fe->ops.get_property(fe, tvp); + if (r < 0) + return r; + } + dtv_property_dump(tvp); return 0;