linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Guido Günther" <agx@sigxcpu.org>
Cc: Tomas Novotny <tomas@novotny.cz>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	"Angus Ainslie (Purism)" <angus@akkea.ca>,
	Marco Felsch <m.felsch@pengutronix.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	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
Date: Thu, 6 Feb 2020 11:24:50 +0000	[thread overview]
Message-ID: <20200206112450.04004361@archlinux> (raw)
In-Reply-To: <86e272aaf6726d6d5171445e7f2df6cdbb74057f.1580721204.git.agx@sigxcpu.org>

On Mon,  3 Feb 2020 10:17:01 +0100
Guido Günther <agx@sigxcpu.org> wrote:

> This will be useful when introducing runtime pm.
> 
> Signed-off-by: Guido Günther <agx@sigxcpu.org>
Applied.

Thanks,

Jonathan

> ---
>  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;


  reply	other threads:[~2020-02-06 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03  9:17 [PATCH v3 0/2] iio: vncl4000: Enable runtime pm for vcnl4200/4040 Guido Günther
2020-02-03  9:17 ` [PATCH v3 1/2] iio: vcnl4000: Use a single return when getting IIO_CHAN_INFO_RAW Guido Günther
2020-02-06 11:24   ` Jonathan Cameron [this message]
2020-02-03  9:17 ` [PATCH v3 2/2] iio: vncl4000: Enable runtime pm for vcnl4200/4040 Guido Günther
2020-02-06 11:26   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200206112450.04004361@archlinux \
    --to=jic23@kernel.org \
    --cc=agx@sigxcpu.org \
    --cc=angus@akkea.ca \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=pmeerw@pmeerw.net \
    --cc=tglx@linutronix.de \
    --cc=tomas@novotny.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).