Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp581967ybm; Thu, 28 May 2020 09:58:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOCTiCGofEz5CYu/icfFE0Vs9UXYDLR9pzpI3HBl4xdR2GSwbvYTDziUcBr7QCgaLLx223 X-Received: by 2002:a50:f18f:: with SMTP id x15mr4261032edl.228.1590685123911; Thu, 28 May 2020 09:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590685123; cv=none; d=google.com; s=arc-20160816; b=SNjUZj9FCnC0uqU9VoojKLaQRq5jqReq4RGJ+YCfrfVhnlfbriaiByD3kXWvN4FQ75 wbncpaBia9ely+u1UwwfoyaDj1nKeSiM6nNWOsnxwgU02LbxN2br1GOCNTlzOwMsGK9P v1rUdJY/im+B0p/a5RedVwJDY3geAcSwbbgyPvf9n2ADhqnjEmFu4x2K3SFLrqoJW4UM zUykg1H0Ypv2MqExgmcc+rQlOQRCcPP6nkbPmQOyrFx7Jr2ELRWbv7XxGJT22ufjU6vk Kg1V4C/FQvX6uTRLUHyEAwabrSl4E48Z4mR0TflJIp2wlq0UBTdb1BKuihgcI2vl7JiS ZPDA== 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=mvqThYI0DoXcxyE2vfKqa5e5T/DelOltOCXTntLvSv5jWmm+CmZUv4QMAR1ogso+zY YrBidJin7p5OTPVTnbnHHCqtuNjeeogmJ6MQWlceY4+QaOVfBD3WurNzCt6wPyz4dYvE 2SQjreXfdF8AMdWtKRtGTmKuJhn0w0VEywPSsOK+qWbu/UdMTDluv38YuYC6szYsZP3P UJigmp15TAk+OHLJqkWrhsklUu5c944c/n8j+wiZe3qQzC/v9ZQSnVNq3ABJrrV+LQN0 hYn4ZUxioUy5pvvzTqhLnX46HUCAOETWScTfzssblMtf+lux2tcSMlz+1ZNnqJAOPM2o gOUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Q38lBNgr; 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 ny24si4032327ejb.445.2020.05.28.09.58.20; Thu, 28 May 2020 09:58:43 -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=Q38lBNgr; 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 S2405288AbgE1Q4K (ORCPT + 99 others); Thu, 28 May 2020 12:56:10 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:57339 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405281AbgE1Qz7 (ORCPT ); Thu, 28 May 2020 12:55:59 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1590684959; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=FLLyoTMv2qd+bBSzR6F92Az2OsSPwUQMzo3EODrQepg=; b=Q38lBNgrTH4hf8o+bnsacWAnpAyUoGN3kuqudhGJ2ai4U5ia5kzR9/TuPyvjZPHo9idu8ITv OIyPbaI4A1tAFW4wLvUX/ZKxPv4UwzG8/FMHRghMuLP4QkDboML9tBOHs6mO4C2FQBIquA82 kFVc6dIJ1DGGsx/CW1UtLl72iHM= X-Mailgun-Sending-Ip: 69.72.43.7 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 5ecfed1f50867324816101b9 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 28 May 2020 16:55:59 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2BC72C433B2; Thu, 28 May 2020 16:55:57 +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 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 E6A05C433CA; Thu, 28 May 2020 16:55:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E6A05C433CA 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 V6 5/7] iio: adc: Update return value checks Date: Thu, 28 May 2020 22:24:27 +0530 Message-Id: <1590684869-15400-6-git-send-email-jprakash@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590684869-15400-1-git-send-email-jprakash@codeaurora.org> References: <1590684869-15400-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