diff mbox

[V2] iio: ad9523: Fix displayed phase

Message ID 20180625080307.14754-1-alexandru.ardelean@analog.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Alexandru Ardelean June 25, 2018, 8:03 a.m. UTC
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(-)

Comments

Jonathan Cameron June 30, 2018, 6:06 p.m. UTC | #1
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;

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;