iio:adf4350: Fix typo
authorMichael Hennerich <michael.hennerich@analog.com>
Thu, 6 Dec 2012 16:09:00 +0000 (16:09 +0000)
committerJonathan Cameron <jic23@kernel.org>
Thu, 27 Dec 2012 10:59:29 +0000 (10:59 +0000)
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/frequency/adf4350.c

index e35bb8f6fe7597e8823527772b119cd3b579377d..c7de8b5a01ff8ce3041a2b336c5505d5f2ef1fb9 100644 (file)
@@ -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;