[RFC PATCH 2/4] ARM: dt: register local timers as early platform devices

Grant Likely grant.likely at secretlab.ca
Sat Jun 25 16:47:42 EDT 2011


On Fri, Jun 24, 2011 at 03:10:57PM +0100, Marc Zyngier wrote:
> Use of_early_platform_populate() to collect nodes with the
> "localtimer" compatible property and register them with
> the early platform "bus".
> 
> Signed-off-by: Marc Zyngier <marc.zyngier at arm.com>
> ---
>  arch/arm/kernel/time.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
> index 32d0df8..08a28ef 100644
> --- a/arch/arm/kernel/time.c
> +++ b/arch/arm/kernel/time.c
> @@ -25,6 +25,7 @@
>  #include <linux/timer.h>
>  #include <linux/irq.h>
>  #include <linux/platform_device.h>
> +#include <linux/of_platform.h>
>  
>  #include <linux/mc146818rtc.h>
>  
> @@ -156,6 +157,9 @@ static void __init __arm_late_time_init(void)
>  		arm_late_time_init();
>  
>  #ifdef CONFIG_LOCAL_TIMER_DEVICES
> +#ifdef CONFIG_OF_FLATTREE
> +	of_early_platform_populate("localtimer");
> +#endif

Rather than #ifdeffing around the function call, it is often cleaner
to have an #else in the header file that defines an empty static
inline.

>  	early_platform_driver_register_all("localtimer");
>  	early_platform_driver_probe("localtimer", 1, 0);

I suggested in my other reply that early_platform_driver should not be
used.  It looks like it is already being used, so I'll back off a bit
from that position.  However, the structure of the code really
shouldn't be any different between clock devices being statically
declared vs. clock data being obtained from the DT.

g.




More information about the linux-arm-kernel mailing list