linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Mircea Caprioru <mircea.caprioru@analog.com>
Cc: <Michael.Hennerich@analog.com>, <alexandru.ardelean@analog.com>,
	<lars@metafoo.de>, <gregkh@linuxfoundation.org>,
	<linux-kernel@vger.kernel.org>, <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: core: Fix handling of 'dB'
Date: Sat, 4 Apr 2020 17:46:24 +0100	[thread overview]
Message-ID: <20200404174624.0b7f1c80@archlinux> (raw)
In-Reply-To: <20200401112230.4708-1-mircea.caprioru@analog.com>

On Wed, 1 Apr 2020 14:22:30 +0300
Mircea Caprioru <mircea.caprioru@analog.com> wrote:

> This patch fixes the call to iio_str_to_fixpoint when using 'dB' sufix.
> Before this the scale_db was not used when parsing the string written to
> the attribute and it failed with invalid value.
> 
> Fixes: b8528224741b ("iio: core: Handle 'dB' suffix in core")
> Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com>

Gah, I guess this messed up around the introduction of the character handling.

Applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/industrialio-core.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 157d95a24faa..7da9cd2a2b58 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -909,14 +909,11 @@ static ssize_t iio_write_channel_info(struct device *dev,
>  			return -EINVAL;
>  		integer = ch;
>  	} else {
> -		ret = iio_str_to_fixpoint(buf, fract_mult, &integer, &fract);
> +		ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
> +					    scale_db);
>  		if (ret)
>  			return ret;
>  	}
> -	ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
> -				    scale_db);
> -	if (ret)
> -		return ret;
>  
>  	ret = indio_dev->info->write_raw(indio_dev, this_attr->c,
>  					 integer, fract, this_attr->address);


      reply	other threads:[~2020-04-04 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 11:22 [PATCH] iio: core: Fix handling of 'dB' Mircea Caprioru
2020-04-04 16:46 ` Jonathan Cameron [this message]

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=20200404174624.0b7f1c80@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mircea.caprioru@analog.com \
    /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).