From patchwork Wed Mar 16 11:04: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: 8598251 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 8467D9F3D1 for ; Wed, 16 Mar 2016 11:05:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA84E2008F for ; Wed, 16 Mar 2016 11:05:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41E1F2026C for ; Wed, 16 Mar 2016 11:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966749AbcCPLFM (ORCPT ); Wed, 16 Mar 2016 07:05:12 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33234 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966465AbcCPLFJ (ORCPT ); Wed, 16 Mar 2016 07:05:09 -0400 Received: by mail-lb0-f172.google.com with SMTP id oe12so45548654lbc.0 for ; Wed, 16 Mar 2016 04:05:08 -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=kmEd8KKA0zkb4/+O7oZtNVRZO3TA54HMgvTVVHHfqzI=; b=ahE6KZGfkgQylUnHoEZ/kfm0HJdC/93b822ElObsFLDL1BgwJGSBt0V9d5u7z0T9OP 2wKazHgNvyz3EsIKHdtfRg16xkGckRgiLr947CI08fU9qyapPjqItUYmW5hpw6o8JHQt cK/fA/n8JFF8t0OiOCoCTmCb0BwVAwFLVe8iYbGapEeWWa4xMObc57s+3I9A5ln9ruTr QYMBgm8CC4qx+mzHc4K8aiKq6EL7AaeZCpcuTUZDxo2lh4w89kTDh9SyIKSQPHtCQyq8 bnFU0KqUcDxuUai0MmJzvWIqQx5MZc6+BvAT9yCP5pvsh0WQypEuRwu6MLqCtECZo7oN SIcQ== X-Gm-Message-State: AD7BkJIl000XlPCIYnUVhuCe7fg5iRzphWrGXLoF5lRnrEFN/fQe9h0Yc+x9twwXk0v83g== X-Received: by 10.112.55.97 with SMTP id r1mr1120024lbp.78.1458126307599; Wed, 16 Mar 2016 04:05:07 -0700 (PDT) Received: from dl160.lan (178-55-1-76.bb.dnainternet.fi. [178.55.1.76]) by smtp.gmail.com with ESMTPSA id o1sm446184lbc.26.2016.03.16.04.05.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Mar 2016 04:05:06 -0700 (PDT) From: Olli Salonen To: linux-media@vger.kernel.org Cc: Olli Salonen Subject: [PATCHv2 1/2] ds3000: return meaningful return codes Date: Wed, 16 Mar 2016 13:04:50 +0200 Message-Id: <1458126291-13914-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. v1 of the patch series got incorrect subject lines. 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 */