devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Artur Rojek <contact@artur-rojek.eu>
Cc: Sebastian Reichel <sre@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>
Subject: Re: [PATCH v2 2/4] iio: inkern: Convert iio_read_avail_channel_raw into a wrapper
Date: Sun, 24 Mar 2019 15:27:50 +0000	[thread overview]
Message-ID: <20190324152750.43edf737@archlinux> (raw)
In-Reply-To: <20190323172809.14407-2-contact@artur-rojek.eu>

On Sat, 23 Mar 2019 18:28:07 +0100
Artur Rojek <contact@artur-rojek.eu> wrote:

> Convert "iio_read_avail_channel_raw" over to a wrapper around
> "iio_read_avail_channel_attribute".
> 
> With the introduction of "iio_read_avail_channel_attribute",
> the necessity of having a separate call to read raw channel values
> became redundant.
> 
> Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> 
> Changes:
> 
> v2: new patch
> 
>  drivers/iio/inkern.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index f19dbde3c945..4a5eff3f18bc 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -759,16 +759,8 @@ int iio_read_avail_channel_raw(struct iio_channel *chan,
>  	int ret;
>  	int type;
>  
> -	mutex_lock(&chan->indio_dev->info_exist_lock);
> -	if (!chan->indio_dev->info) {
> -		ret = -ENODEV;
> -		goto err_unlock;
> -	}
> -
> -	ret = iio_channel_read_avail(chan,
> -				     vals, &type, length, IIO_CHAN_INFO_RAW);
> -err_unlock:
> -	mutex_unlock(&chan->indio_dev->info_exist_lock);
> +	ret = iio_read_avail_channel_attribute(chan, vals, &type, length,
> +					 IIO_CHAN_INFO_RAW);
>  
>  	if (ret >= 0 && type != IIO_VAL_INT)
>  		/* raw values are assumed to be IIO_VAL_INT */

  reply	other threads:[~2019-03-24 15:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 17:28 [PATCH v2 1/4] iio: inkern: API for reading available iio channel attribute values Artur Rojek
2019-03-23 17:28 ` [PATCH v2 2/4] iio: inkern: Convert iio_read_avail_channel_raw into a wrapper Artur Rojek
2019-03-24 15:27   ` Jonathan Cameron [this message]
2019-04-14 10:35     ` Jonathan Cameron
2019-03-23 17:28 ` [PATCH v2 3/4] dt-bindings: power: supply: Add docs for Ingenic JZ47xx SoCs battery Artur Rojek
2019-03-24 15:30   ` Jonathan Cameron
2019-04-18 19:47     ` Sebastian Reichel
2019-03-23 17:28 ` [PATCH v2 4/4] power: supply: add Ingenic JZ47xx battery driver Artur Rojek
2019-03-24 15:31   ` Jonathan Cameron
2019-04-07 16:52     ` Sebastian Reichel
2019-04-07 19:07       ` Paul Cercueil
2019-04-08  9:38         ` Sebastian Reichel
2019-04-08 10:23           ` Paul Cercueil
2019-04-14 10:37       ` Jonathan Cameron
2019-04-15 22:09   ` Sebastian Reichel
2019-03-24 15:27 ` [PATCH v2 1/4] iio: inkern: API for reading available iio channel attribute values Jonathan Cameron
2019-04-14 10:34   ` Jonathan Cameron
2019-04-18 19:47     ` Sebastian Reichel

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=20190324152750.43edf737@archlinux \
    --to=jic23@kernel.org \
    --cc=contact@artur-rojek.eu \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=paul@crapouillou.net \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /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).