| 1 | From e66a022a80d73b1a5d2e02c9db2c42e8b9853b40 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ben Hutchings <ben@decadent.org.uk> |
| 3 | Date: Sat, 11 Dec 2010 20:17:54 +0000 |
| 4 | Subject: [PATCH] arm/ixp4xx: Rename FREQ macro to avoid collisions |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | FREQ is a ridiculously short name for a platform-specific macro in a |
| 10 | generic header, and it now conflicts with an enumeration in the |
| 11 | gspca/ov519 driver. |
| 12 | |
| 13 | Also delete conditional reference to ixp4xx_get_board_tick_rate() |
| 14 | which is not defined anywhere. |
| 15 | |
| 16 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> |
| 17 | Signed-off-by: Krzysztof HaĆasa <khc@pm.waw.pl> |
| 18 | --- |
| 19 | arch/arm/mach-ixp4xx/common.c | 4 ++-- |
| 20 | arch/arm/mach-ixp4xx/include/mach/timex.h | 5 +++-- |
| 21 | drivers/input/misc/ixp4xx-beeper.c | 6 +----- |
| 22 | 3 files changed, 6 insertions(+), 9 deletions(-) |
| 23 | |
| 24 | --- a/arch/arm/mach-ixp4xx/common.c |
| 25 | +++ b/arch/arm/mach-ixp4xx/common.c |
| 26 | @@ -454,7 +454,7 @@ static struct clocksource clocksource_ix |
| 27 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
| 28 | }; |
| 29 | |
| 30 | -unsigned long ixp4xx_timer_freq = FREQ; |
| 31 | +unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; |
| 32 | EXPORT_SYMBOL(ixp4xx_timer_freq); |
| 33 | static void __init ixp4xx_clocksource_init(void) |
| 34 | { |
| 35 | @@ -530,7 +530,7 @@ static struct clock_event_device clockev |
| 36 | |
| 37 | static void __init ixp4xx_clockevent_init(void) |
| 38 | { |
| 39 | - clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC, |
| 40 | + clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC, |
| 41 | clockevent_ixp4xx.shift); |
| 42 | clockevent_ixp4xx.max_delta_ns = |
| 43 | clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); |
| 44 | --- a/arch/arm/mach-ixp4xx/include/mach/timex.h |
| 45 | +++ b/arch/arm/mach-ixp4xx/include/mach/timex.h |
| 46 | @@ -10,6 +10,7 @@ |
| 47 | * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the |
| 48 | * timer register ignores the bottom 2 bits of the LATCH value. |
| 49 | */ |
| 50 | -#define FREQ 66666000 |
| 51 | -#define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) |
| 52 | +#define IXP4XX_TIMER_FREQ 66666000 |
| 53 | +#define CLOCK_TICK_RATE \ |
| 54 | + (((IXP4XX_TIMER_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) |
| 55 | |
| 56 | --- a/drivers/input/misc/ixp4xx-beeper.c |
| 57 | +++ b/drivers/input/misc/ixp4xx-beeper.c |
| 58 | @@ -69,11 +69,7 @@ static int ixp4xx_spkr_event(struct inpu |
| 59 | } |
| 60 | |
| 61 | if (value > 20 && value < 32767) |
| 62 | -#ifndef FREQ |
| 63 | - count = (ixp4xx_get_board_tick_rate() / (value * 4)) - 1; |
| 64 | -#else |
| 65 | - count = (FREQ / (value * 4)) - 1; |
| 66 | -#endif |
| 67 | + count = (IXP4XX_TIMER_FREQ / (value * 4)) - 1; |
| 68 | |
| 69 | ixp4xx_spkr_control(pin, count); |
| 70 | |
| 71 | |