Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1404921ybv; Thu, 6 Feb 2020 03:31:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwSyEnAz+N+BcJ5miU5SAfiNsmuxhmS9r7fLU79vdU0siwNfpYPhFdHiOONqqi5TF4gYarN X-Received: by 2002:a9d:2c2:: with SMTP id 60mr30089590otl.208.1580988682440; Thu, 06 Feb 2020 03:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580988682; cv=none; d=google.com; s=arc-20160816; b=erWgKiR+upcXQrtLL3s6DEuJzzrWU+U6JLeAJ6fpLSJxXMefASjUk5qvUc1NbUTI1s 5+6ltc15IWMNNZqvHs3yHqP81idwTRXY4HrPtMvjuWKr8D5hkHci9aNCE0wuDVCjGwhL TtXkhJT/6Ecb/0BmhjDWMjQv3gqUkPSJEWZE8lLSdZcf3y9blm56U0VOFV7Bmvxs/d7j lfRhvWM3mKraWCs05t/heXsDQRCqOx3HDU69Di5FegBHfh7oydgvkhE/hN0yoyrGWfhA PKsJ6XKIfoT+/uhbn0OWWanJEyKaQ3TWwTbTyOum/YosAoK1x8SXR8nzJJEA/5heBF4N c6hQ== 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:subject:cc:to:from:date :dkim-signature; bh=NzZu4erxNuolehD5QcZ5qgHpUnGbAB6pP/ZMbDsftsI=; b=ZrcABnBvFtNP4Nic2pVvWPObnPXdATs6KrFdnyYdih4RHiIEg8KH4jwcWCEuYb2kaY HboSPlgp/YVLQOGWmigSssgLjk31uXLH1jNjv9+/jsZqJV34XSEhuKyvuDEBLAUyxs0/ E1Ns43vjsFriv9HdB/pbENnO28RWYeIv/6b7HjdIV6K0zCXiU2SlMB5VNG0I2rCX0TUl AX+t0DLxGSPLCJi6Z9hBR/TK+z66K4YzDVqMfcvqnhvEuFD5npAJpC+tYrCCtVKJAUs8 zbeE8fWDcZTUtB8XCYEZ+HQu+p/EyGlUq2+uRzlgBQFgLrIZRfNP+btDrMKJx3sgOAwJ mWqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VND0uD4F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si1926566oia.15.2020.02.06.03.31.09; Thu, 06 Feb 2020 03:31:22 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VND0uD4F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727390AbgBFLY5 (ORCPT + 99 others); Thu, 6 Feb 2020 06:24:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:58042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbgBFLY5 (ORCPT ); Thu, 6 Feb 2020 06:24:57 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A706E20730; Thu, 6 Feb 2020 11:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580988296; bh=nveUzTkK3SAXe1XV2O7CxMbqKFRC1dGbyd31nxACb+I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VND0uD4FlfS/1Uavbf+jM+n+nW4tbxmLvBxCDoEey4ltzMh5ovFcNqIAB0HZvptUl bib8JMh8q4tOSl94eRmFhxu1BjMEZmhLmK1k38ybIqx2MgnQZxxV6fUsOG6+1IK3WG SgjmqlqqAYh+w3lk0wvF9P7/qVclR+pUKl/KwK6Q= Date: Thu, 6 Feb 2020 11:24:50 +0000 From: Jonathan Cameron To: Guido =?UTF-8?B?R8O8bnRoZXI=?= Cc: Tomas Novotny , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "Angus Ainslie (Purism)" , Marco Felsch , Thomas Gleixner , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] iio: vcnl4000: Use a single return when getting IIO_CHAN_INFO_RAW Message-ID: <20200206112450.04004361@archlinux> In-Reply-To: <86e272aaf6726d6d5171445e7f2df6cdbb74057f.1580721204.git.agx@sigxcpu.org> References: <86e272aaf6726d6d5171445e7f2df6cdbb74057f.1580721204.git.agx@sigxcpu.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Feb 2020 10:17:01 +0100 Guido G=C3=BCnther wrote: > This will be useful when introducing runtime pm. >=20 > Signed-off-by: Guido G=C3=BCnther Applied. Thanks, Jonathan > --- > drivers/iio/light/vcnl4000.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) >=20 > 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 =3D data->chip_spec->measure_light(data, val); > - if (ret < 0) > - return ret; > - return IIO_VAL_INT; > + if (!ret) > + ret =3D IIO_VAL_INT; > + break; > case IIO_PROXIMITY: > ret =3D data->chip_spec->measure_proximity(data, val); > - if (ret < 0) > - return ret; > - return IIO_VAL_INT; > + if (!ret) > + ret =3D IIO_VAL_INT; > + break; > default: > - return -EINVAL; > + ret =3D -EINVAL; > } > + return ret; > case IIO_CHAN_INFO_SCALE: > if (chan->type !=3D IIO_LIGHT) > return -EINVAL;