linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio:adf4350: Fix typo
@ 2012-12-06 16:09 Lars-Peter Clausen
  2012-12-08  9:53 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-12-06 16:09 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Michael Hennerich, Lars-Peter Clausen

From: Michael Hennerich <michael.hennerich@analog.com>

There is a typo in the adf4350 driver turning a shift into a compare. This patch
fixes it.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/frequency/adf4350.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index e35bb8f..c7de8b5 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -173,7 +173,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
 			} while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt);
 		} while (r_cnt == 0);
 
-		tmp = freq * (u64)st->r1_mod + (st->fpfd > 1);
+		tmp = freq * (u64)st->r1_mod + (st->fpfd >> 1);
 		do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */
 		st->r0_fract = do_div(tmp, st->r1_mod);
 		st->r0_int = tmp;
-- 
1.8.0


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

* Re: [PATCH] iio:adf4350: Fix typo
  2012-12-06 16:09 [PATCH] iio:adf4350: Fix typo Lars-Peter Clausen
@ 2012-12-08  9:53 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-12-08  9:53 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Jonathan Cameron, linux-iio, Michael Hennerich

On 12/06/2012 04:09 PM, Lars-Peter Clausen wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
> 
> There is a typo in the adf4350 driver turning a shift into a compare. This patch
> fixes it.
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
added to fixes-togreg branch of iio.git

> ---
>  drivers/iio/frequency/adf4350.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
> index e35bb8f..c7de8b5 100644
> --- a/drivers/iio/frequency/adf4350.c
> +++ b/drivers/iio/frequency/adf4350.c
> @@ -173,7 +173,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
>  			} while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt);
>  		} while (r_cnt == 0);
>  
> -		tmp = freq * (u64)st->r1_mod + (st->fpfd > 1);
> +		tmp = freq * (u64)st->r1_mod + (st->fpfd >> 1);
>  		do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */
>  		st->r0_fract = do_div(tmp, st->r1_mod);
>  		st->r0_int = tmp;
> 

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

end of thread, other threads:[~2012-12-08  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-06 16:09 [PATCH] iio:adf4350: Fix typo Lars-Peter Clausen
2012-12-08  9:53 ` 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).