From patchwork Wed Mar 16 11:02:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olli Salonen X-Patchwork-Id: 8598121 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 36F329F3D1 for ; Wed, 16 Mar 2016 11:03:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B86B22008F for ; Wed, 16 Mar 2016 11:03:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E3F7201EF for ; Wed, 16 Mar 2016 11:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966647AbcCPLDE (ORCPT ); Wed, 16 Mar 2016 07:03:04 -0400 Received: from mail-lb0-f194.google.com ([209.85.217.194]:33907 "EHLO mail-lb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966644AbcCPLDA (ORCPT ); Wed, 16 Mar 2016 07:03:00 -0400 Received: by mail-lb0-f194.google.com with SMTP id vk4so3113767lbb.1 for ; Wed, 16 Mar 2016 04:02:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KUCDq4MdcUHieDSMaRU/moYvqFb/gORFkdeKmziijyk=; b=VDLPwiFSPuOX9SyKDc2bn2iSFzvB2gY6L7FNyYSMnpcVBObRnpjMfP0ZOC6QiHlsz4 CnT/jDFmoa9owv/FUp0Z6B5ijEw4wT9jJMHOTSXKQrOmSva5eB5bWy7mK8CtQhDM2EPR pHorQNhrWNyX0ZD18hG/hy1i/iAjk8szL5YhM9ejq4F4t02hrhW/fkNROjOPpbbqYvAp sI3Hft6B0YRnE4oGjnD91X8POrqapg0G0SfLw6HwVaBXDEMJqUj32frXgNdTuvvhKE7Z N/94y+0dQb/LR89b5ZHN9ug+XUK6jz3Zhx1VBNgK9Sw1Z7pttRJzWOg4Z7PjcPK82zc+ ZpJA== X-Gm-Message-State: AD7BkJKvpHoaNqjXvxZNWMl5ieLc9Ph+BljBCjFDCu3/rXKKyfWXuHgamo6FeQpvCY0atg== X-Received: by 10.112.161.225 with SMTP id xv1mr1125279lbb.127.1458126178942; Wed, 16 Mar 2016 04:02:58 -0700 (PDT) Received: from dl160.lan (178-55-1-76.bb.dnainternet.fi. [178.55.1.76]) by smtp.gmail.com with ESMTPSA id i8sm426382lbj.30.2016.03.16.04.02.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Mar 2016 04:02:58 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCH 1/2] ds3000: return meaningful return codes Date: Wed, 16 Mar 2016 13:02:50 +0200 Message-Id: <1458126171-13871-1-git-send-email-olli.salonen@iki.fi> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The ds3000 driver returned 1 as an error code in many places. Signed-off-by: Olli Salonen --- drivers/media/dvb-frontends/ds3000.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index e8fc032..addffc3 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -458,7 +458,7 @@ static int ds3000_read_status(struct dvb_frontend *fe, enum fe_status *status) break; default: - return 1; + return -EINVAL; } if (state->config->set_lock_led) @@ -528,7 +528,7 @@ static int ds3000_read_ber(struct dvb_frontend *fe, u32* ber) *ber = 0xffffffff; break; default: - return 1; + return -EINVAL; } return 0; @@ -623,7 +623,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr) snr_reading, *snr); break; default: - return 1; + return -EINVAL; } return 0; @@ -661,7 +661,7 @@ static int ds3000_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) state->prevUCBS2 = _ucblocks; break; default: - return 1; + return -EINVAL; } return 0; @@ -754,7 +754,7 @@ static int ds3000_send_diseqc_msg(struct dvb_frontend *fe, data |= 0x80; ds3000_writereg(state, 0xa2, data); - return 1; + return -ETIMEDOUT; } data = ds3000_readreg(state, 0xa2); @@ -808,7 +808,7 @@ static int ds3000_diseqc_send_burst(struct dvb_frontend *fe, data |= 0x80; ds3000_writereg(state, 0xa2, data); - return 1; + return -ETIMEDOUT; } data = ds3000_readreg(state, 0xa2); @@ -951,7 +951,7 @@ static int ds3000_set_frontend(struct dvb_frontend *fe) ds3000_writereg(state, 0xfe, 0x98); break; default: - return 1; + return -EINVAL; } /* enable 27MHz clock output */