[PATCH 02/39] ARM: u300: device tree support for the timer
Arnd Bergmann
arnd at arndb.de
Fri May 31 06:31:41 EDT 2013
On Friday 31 May 2013 11:18:37 Linus Walleij wrote:
> +
> +
> +void __init u300_timer_init()
> +{
> + u300_timer_setup(U300_TIMER_APP_VBASE, IRQ_U300_TIMER_APP_GP1);
> +}
> +
> +#ifdef CONFIG_OF
> +
> +static void __init u300_timer_init_of(struct device_node *np)
> +{
> + void __iomem *base;
> + struct resource irq_res;
> + int irq;
> +
> + base = of_iomap(np, 0);
> + /* Get the IRQ for the GP1 timer */
> + irq = of_irq_to_resource(np, 2, &irq_res);
> + u300_timer_setup(base, irq);
> +}
> +
> +CLOCKSOURCE_OF_DECLARE(u300_timer, "stericsson,u300-apptimer",
> + u300_timer_init_of);
> +
> +#endif
You should not need the CONFIG_OF #ifdef, since the CLOCKSOURCE_OF_DECLARE
macro is designed to let the function get dropped by the compiler when
that is not set.
You might want a CONFIG_ATAGS check for the other function though.
> diff --git a/arch/arm/mach-u300/timer.h b/arch/arm/mach-u300/timer.h
> index d34287b..7766dfa 100644
> --- a/arch/arm/mach-u300/timer.h
> +++ b/arch/arm/mach-u300/timer.h
> @@ -1 +1,2 @@
> extern void u300_timer_init(void);
> +
>
You probably didn't mean to include this newline.
Arnd
More information about the linux-arm-kernel
mailing list