From patchwork Wed Sep 12 02:27:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 1440721 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C2B18DFAF3 for ; Wed, 12 Sep 2012 02:28:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759459Ab2ILC2S (ORCPT ); Tue, 11 Sep 2012 22:28:18 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:56494 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756381Ab2ILC1m (ORCPT ); Tue, 11 Sep 2012 22:27:42 -0400 Received: from dyn3-82-128-184-7.psoas.suomi.net ([82.128.184.7] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TBcg1-0000BC-US; Wed, 12 Sep 2012 05:27:41 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Thomas Mair , Antti Palosaari Subject: [PATCH 3/8] af9035: relax frontend callback error handling Date: Wed, 12 Sep 2012 05:27:06 +0300 Message-Id: <1347416831-1413-3-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347416831-1413-1-git-send-email-crope@iki.fi> References: <1347416831-1413-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.184.7 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 is not good idea to return error for missing callback handler as whole callback as optional and could be missing by intentionally. Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index b700444..fdec3b1 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -652,7 +652,7 @@ static int af9035_tuner_callback(struct dvb_usb_device *d, int cmd, int arg) break; } - return -ENODEV; + return 0; } static int af9035_frontend_callback(void *adapter_priv, int component, @@ -661,6 +661,9 @@ static int af9035_frontend_callback(void *adapter_priv, int component, struct i2c_adapter *adap = adapter_priv; struct dvb_usb_device *d = i2c_get_adapdata(adap); + dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n", + __func__, component, cmd, arg); + switch (component) { case DVB_FRONTEND_COMPONENT_TUNER: return af9035_tuner_callback(d, cmd, arg); @@ -668,7 +671,7 @@ static int af9035_frontend_callback(void *adapter_priv, int component, break; } - return -EINVAL; + return 0; } static int af9035_frontend_attach(struct dvb_usb_adapter *adap)