linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] iio: ad9523: Fix displayed phase
@ 2018-06-25  8:03 Alexandru Ardelean
  2018-06-30 18:06 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2018-06-25  8:03 UTC (permalink / raw)
  To: linux-iio, lars, Michael.Hennerich, jic23; +Cc: Alexandru Ardelean

From: Lars-Peter Clausen <lars@metafoo.de>

Fix the displayed phase for the ad9523 driver. Currently the most
significant decimal place is dropped and all other digits are shifted one
to the left. This is due to a multiplication by 10, which is not necessary,
so remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---

v1 -> v2:
* added Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

 drivers/iio/frequency/ad9523.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
index ddb6a334ae68..d5b2c231a661 100644
--- a/drivers/iio/frequency/ad9523.c
+++ b/drivers/iio/frequency/ad9523.c
@@ -642,7 +642,7 @@ static int ad9523_read_raw(struct iio_dev *indio_dev,
 		code = (AD9523_CLK_DIST_DIV_PHASE_REV(ret) * 3141592) /
 			AD9523_CLK_DIST_DIV_REV(ret);
 		*val = code / 1000000;
-		*val2 = (code % 1000000) * 10;
+		*val2 = code % 1000000;
 		return IIO_VAL_INT_PLUS_MICRO;
 	default:
 		return -EINVAL;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] iio: ad9523: Fix displayed phase
  2018-06-25  8:03 [PATCH V2] iio: ad9523: Fix displayed phase Alexandru Ardelean
@ 2018-06-30 18:06 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-06-30 18:06 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, lars, Michael.Hennerich

On Mon, 25 Jun 2018 11:03:07 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> From: Lars-Peter Clausen <lars@metafoo.de>
> 
> Fix the displayed phase for the ad9523 driver. Currently the most
> significant decimal place is dropped and all other digits are shifted one
> to the left. This is due to a multiplication by 10, which is not necessary,
> so remove it.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Marked for stable and a fixes tag added for the original introduction of
the driver.

Applied to the fixes-togreg branch of iio.git

Thanks,

Jonathan

> ---
> 
> v1 -> v2:
> * added Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> 
>  drivers/iio/frequency/ad9523.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
> index ddb6a334ae68..d5b2c231a661 100644
> --- a/drivers/iio/frequency/ad9523.c
> +++ b/drivers/iio/frequency/ad9523.c
> @@ -642,7 +642,7 @@ static int ad9523_read_raw(struct iio_dev *indio_dev,
>  		code = (AD9523_CLK_DIST_DIV_PHASE_REV(ret) * 3141592) /
>  			AD9523_CLK_DIST_DIV_REV(ret);
>  		*val = code / 1000000;
> -		*val2 = (code % 1000000) * 10;
> +		*val2 = code % 1000000;
>  		return IIO_VAL_INT_PLUS_MICRO;
>  	default:
>  		return -EINVAL;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-30 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25  8:03 [PATCH V2] iio: ad9523: Fix displayed phase Alexandru Ardelean
2018-06-30 18:06 ` Jonathan Cameron

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).