Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1786496ybl; Thu, 30 Jan 2020 06:04:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwPiAsLDoqUZRg9e98xRbX74r/vutuK15uGVKNiP2E5MnuDJsa8yObzdfgCM31bkJfACz72 X-Received: by 2002:a9d:4f11:: with SMTP id d17mr3478330otl.228.1580393040731; Thu, 30 Jan 2020 06:04:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580393040; cv=none; d=google.com; s=arc-20160816; b=yaJ/bWmwAbFkY92UvqRJc5rCF0xSAqxmBLwrIwA8B/CVS3EdWl2LdTfaCHam3LeWp0 2+6B7l8EpUb9kGpT1z0TKsShpB84rQhVa+8siQG+Y+HkBa8PosxZEXPl5dCCnIl8nWL3 y8JbjQtAWGTt1aOjU8ktz3I35ERYR3IjszfLoPqre7mnFoDQ+MBnJfqsrqO49hflEcRy j0U0vJRjJMLnxY/rFPg5hKMlS6D01SK3/sz3zrfS3L4QKDPD8DwLkEo8OuS0uBag/nmK O+8KSxbpgeCAPQPeoK2pfQ3dd8IiH2Vg6BZw9ePwTh7VI3RNq6js+zsBVtQnECFlsPPo zRdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=FNiBrGR95ZfieUIKFny8yXT8vtw+UkMs6N5KIFZkwY8=; b=gL+ASfOvT1nVSM7/cxMaeK+AdU9IVZrVaEJC8k0HEeG13/7ELGH8VABbJxGR/Y+PBc 6ULdRGexcOAQS72i121wFZsa4bdo7mC1gZRQNUVav5oB4rK0l9pOMCAucf2GB2v4XaH/ IOxMJrhfSqb8Kg/jhfcDxLPl11+CgLtkwUsTcoQpYoEdEr07xIbhCrPKkgs3w3Ke7ezu pyUPBTNQxY+qay8VOQ5DyvXP+tvKce0sdcQ8xO9kW5efw4rfRxzMH2XB3JgVoCDg0tPq jhO0Vq+NNDug9qd9ewVcrNvM3MNqtoWHUAgVmSeggUwv7rUCz4PME1F6hMzuW91v0++o YIMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si3290213otd.143.2020.01.30.06.03.43; Thu, 30 Jan 2020 06:04:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727391AbgA3Nmo (ORCPT + 99 others); Thu, 30 Jan 2020 08:42:44 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:53262 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726980AbgA3Nmm (ORCPT ); Thu, 30 Jan 2020 08:42:42 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id B5E6DFB02; Thu, 30 Jan 2020 14:42:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NLp-z8NNH201; Thu, 30 Jan 2020 14:42:37 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id CD7524091D; Thu, 30 Jan 2020 14:42:36 +0100 (CET) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: Tomas Novotny , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "Angus Ainslie (Purism)" , =?UTF-8?q?Guido=20G=C3=BCnther?= , Marco Felsch , Thomas Gleixner , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] iio: vcnl4000: Use a single return when getting IIO_CHAN_INFO_RAW Date: Thu, 30 Jan 2020 14:42:35 +0100 Message-Id: <86e272aaf6726d6d5171445e7f2df6cdbb74057f.1580391472.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will be useful when introducing runtime pm. Signed-off-by: Guido Günther --- drivers/iio/light/vcnl4000.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index b0e241aaefb4..8f198383626b 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -335,17 +335,18 @@ static int vcnl4000_read_raw(struct iio_dev *indio_dev, switch (chan->type) { case IIO_LIGHT: ret = data->chip_spec->measure_light(data, val); - if (ret < 0) - return ret; - return IIO_VAL_INT; + if (!ret) + ret = IIO_VAL_INT; + break; case IIO_PROXIMITY: ret = data->chip_spec->measure_proximity(data, val); - if (ret < 0) - return ret; - return IIO_VAL_INT; + if (!ret) + ret = IIO_VAL_INT; + break; default: - return -EINVAL; + ret = -EINVAL; } + return ret; case IIO_CHAN_INFO_SCALE: if (chan->type != IIO_LIGHT) return -EINVAL; -- 2.23.0