Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3570903ybl; Mon, 3 Feb 2020 02:46:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyf48Te8T478k4Vxj/o0neo0Eg3DHhSLYW1154lVZBNngY8gtYfeEbge2tnbWoiIOChNwPc X-Received: by 2002:a9d:6289:: with SMTP id x9mr17720668otk.8.1580726803321; Mon, 03 Feb 2020 02:46:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580726803; cv=none; d=google.com; s=arc-20160816; b=RuSs8h1oR2VRjmUDtYGrASayl2W841OEq7wQHJ1IXTZC8F8c4BiTR51KDiU/89+OU3 jMf4om2Qjmu4f8u3CZjcP40hCKAaXp1OLJZaI/jgOSrYA9GOlK1i+fcxSCUJzhIYSu/l CsJhmZOe1h3UA3iQ/pPikq/DfUX1iNgYokZmw0c74Txw/z+MxJ/f6SOC8PTMtSPyNBNv FDoriJmhIxr+h/VmOl59W9+VQ5jypy0MFciDUfo5/Fdx3syN7vggE5X6u0F9XMoDiKog h/PNaBN5oXV1iOxOfFf7oEUxE2yuUjhNdtys69DMKaWyF/CHWQh/2ZZxuKJRbAQTrKSk yhOw== 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=s6TfUbSLpvYpguPbM5TXWfMSU+ZUlcfKsIz6URA91e7nZLGydANAiOCv7iXUVE3yhJ tjhBclNBSTqf4TEL2GePr7T6FW33vT472vP2EmnwOfhSZp6Z2zduqZkTU//BegsbsWNh Y6VC1kLrgXL3rTdRd7goxRbeWQRPmmD0rHYnh785HTIM6QA66n1tyLKxp0BWhklAdYLL cGJAFT+dMMi6lyzGKayhkVKyPIoR82kLi1oTEKTrHnUNzHgHJerVaxeqts0Obq98T2I1 bIlZvbeNlu3VuWU1ZHqCC/9KeDNroEI3rqlwnLtEPlIvBVWRZtVAJiNjvXOT4Zi3N3rO kBFw== 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 i19si7673057oik.272.2020.02.03.02.46.26; Mon, 03 Feb 2020 02:46:43 -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 S1727887AbgBCJRI (ORCPT + 99 others); Mon, 3 Feb 2020 04:17:08 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:46324 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbgBCJRI (ORCPT ); Mon, 3 Feb 2020 04:17:08 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id E0886FB05; Mon, 3 Feb 2020 10:17:04 +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 Uw_zNkNSlMdK; Mon, 3 Feb 2020 10:17:03 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id DAC00400E4; Mon, 3 Feb 2020 10:17:02 +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 v3 1/2] iio: vcnl4000: Use a single return when getting IIO_CHAN_INFO_RAW Date: Mon, 3 Feb 2020 10:17:01 +0100 Message-Id: <86e272aaf6726d6d5171445e7f2df6cdbb74057f.1580721204.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