Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3384734ybt; Tue, 23 Jun 2020 00:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcyCJyb6uAf221C0Eo7KNUfTViOEz/JmdOqNuz4VHFNVmrYgijwsIPWq6EfDrOo8K7EB0w X-Received: by 2002:a17:906:950c:: with SMTP id u12mr9214749ejx.37.1592897678078; Tue, 23 Jun 2020 00:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592897678; cv=none; d=google.com; s=arc-20160816; b=okjjf3rkQjT9lUbXG/45OGMePnBUsYH6hPpQfhW0hNtCVJRrpKfaobg0KBIOEZOj/n agxcz3gp6wJnqtqtUnXgpJORcuyaqkUvYiT2KENY4HXU0hoUDbuQUgvbUGWk6w7vj058 KPIGsFTy/KWRst+ik5/dX6yyhNpOdvHpFMNqGYRjOgUtg96PB7tLyA8f6B5TupHKlsOK KFPNoXaPK/nWG1yx9WhDN1dsn/5PZM1uCLW7ucOSPAIpqP9+6K2wNRh1d++kEopjRZnX 14pX0MPRg5Hrmxn+V1ENgGOwMUPcFfoe0fg6HDTJuMHGhMCADWFmpIikXCsU5LlDBuKh DIkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=FLLyoTMv2qd+bBSzR6F92Az2OsSPwUQMzo3EODrQepg=; b=RKjB4HPwvI5h147QjzKOIO9+eiFbuhzbI76DhtN3rKUdQzNYrMtvuc7hvJ2gyyiCcg xFMr51DHxU+746a1EckmPAZJByS+9cMXu5n20yjc3neJLeyeAafM4hxCXRC291KY5Ftc 2jMuyUeItAhFCF9MyXUZQqyNnAHBGYOc9CxX/BbDnyJFdjzOzowJKduuj1XpfdPATYGB NhjXbFZ/7e+cYIa4jryIm8mzWEiGyw8JsPQdF9WIjNIcpXS6LVKk6/vX8BaYfeAOIgQh L0Baf0QRBmTHWAjFhcw5jKUcSxTeDpRsRuk3Zv7pA+LfbUnDvfNaALuCtu+4r4BhLe1S DMvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=IByHZD2J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr2si12980587ejc.18.2020.06.23.00.34.15; Tue, 23 Jun 2020 00:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=IByHZD2J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731793AbgFWHba (ORCPT + 99 others); Tue, 23 Jun 2020 03:31:30 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:14540 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731634AbgFWHbV (ORCPT ); Tue, 23 Jun 2020 03:31:21 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1592897481; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=FLLyoTMv2qd+bBSzR6F92Az2OsSPwUQMzo3EODrQepg=; b=IByHZD2JfQnv9GbCLZgKOrGjDWSvilKKgp1FSnZc6DwLsIuSPD7DnitFCYdm1EF//bD8DPcJ s5NLYMTnbSGpxMEUqIzQoLeVH3G+Z8Qd1tKYVUdUSSdytrbWYCcSus7YF2SIebrDn7wA9It7 6a5IeBvEpDWt8IOu5kHMDkC1GVM= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 5ef1afbdad153efa34acff36 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 23 Jun 2020 07:31:09 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 33709C433C8; Tue, 23 Jun 2020 07:31:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from jprakash-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jprakash) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4B4F8C433AF; Tue, 23 Jun 2020 07:31:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4B4F8C433AF Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=jprakash@codeaurora.org From: Jishnu Prakash To: agross@kernel.org, bjorn.andersson@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mka@chromium.org, linus.walleij@linaro.org, Jonathan.Cameron@huawei.com, andy.shevchenko@gmail.com, amit.kucheria@verdurent.com, smohanad@codeaurora.org, kgunda@codeaurora.org, aghayal@codeaurora.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org Cc: linux-arm-msm-owner@vger.kernel.org, Jishnu Prakash Subject: [PATCH V7 5/7] iio: adc: Update return value checks Date: Tue, 23 Jun 2020 12:59:57 +0530 Message-Id: <1592897399-24089-6-git-send-email-jprakash@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592897399-24089-1-git-send-email-jprakash@codeaurora.org> References: <1592897399-24089-1-git-send-email-jprakash@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up some return value checks to make code more compact. Signed-off-by: Jishnu Prakash --- drivers/iio/adc/qcom-spmi-adc5.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c index dcc7599..3022313 100644 --- a/drivers/iio/adc/qcom-spmi-adc5.c +++ b/drivers/iio/adc/qcom-spmi-adc5.c @@ -301,7 +301,7 @@ static int adc5_configure(struct adc5_chip *adc, /* Read registers 0x42 through 0x46 */ ret = adc5_read(adc, ADC5_USR_DIG_PARAM, buf, sizeof(buf)); - if (ret < 0) + if (ret) return ret; /* Digital param selection */ @@ -388,7 +388,7 @@ static int adc5_do_conversion(struct adc5_chip *adc, if (adc->poll_eoc) { ret = adc5_poll_wait_eoc(adc); - if (ret < 0) { + if (ret) { pr_err("EOC bit not set\n"); goto unlock; } @@ -398,7 +398,7 @@ static int adc5_do_conversion(struct adc5_chip *adc, if (!ret) { pr_debug("Did not get completion timeout.\n"); ret = adc5_poll_wait_eoc(adc); - if (ret < 0) { + if (ret) { pr_err("EOC bit not set\n"); goto unlock; } @@ -516,8 +516,6 @@ static int adc5_read_raw(struct iio_dev *indio_dev, default: return -EINVAL; } - - return 0; } static int adc7_read_raw(struct iio_dev *indio_dev, @@ -761,7 +759,7 @@ static int adc5_get_dt_channel_data(struct adc5_chip *adc, ret = adc5_read(adc, ADC5_USR_REVISION1, dig_version, sizeof(dig_version)); - if (ret < 0) { + if (ret) { dev_err(dev, "Invalid dig version read %d\n", ret); return ret; } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project