[RFC PATCH 06/16] ARM: local timers: move Tegra to LOCAL_TIMER_DEVICES/ARM_SMP_TWD
Marc Zyngier
marc.zyngier at arm.com
Thu Jun 16 16:22:45 EDT 2011
On 16/06/11 21:07, Stephen Warren wrote:
> Marc Zyngier wrote at Thursday, June 16, 2011 1:07 PM:
>> Convert the Tegra platforms to use the new arm_smp_twd driver.
>> Add the platform device and register it as early platform device.
>
> ...
>> diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
>> index 9035042..4e1ecd0 100644
>> --- a/arch/arm/mach-tegra/timer.c
>> +++ b/arch/arm/mach-tegra/timer.c
>
> ...
>> +static struct platform_device *tegra_early_devices[] = {
>> + &tegra_twd_device,
>> +};
>
> In the cases where the timer device is registered within a timer-specific
> file, as here, and hence is likely the only device to be registered, does
> it make sense to elide the platform_device array above, and ...
>
> ...
>> @@ -241,6 +261,8 @@ static void __init tegra_init_timer(void)
>> tegra_clockevent.cpumask = cpu_all_mask;
>> tegra_clockevent.irq = tegra_timer_irq.irq;
>> clockevents_register_device(&tegra_clockevent);
>> + early_platform_add_devices(tegra_early_devices,
>> + ARRAY_SIZE(tegra_early_devices));
>> }
>
> ... and just refer to the single device directly here:
>
> early_platform_add_devices(&tegra_twd_device, 1);
>
> ?
Unfortunately not. From include/linux/platform_device.h:
void early_platform_add_devices(struct platform_device **devs, int num);
There is no equivalent of platform_device_register() for early devices,
so the array is mandatory.
Cheers,
M.
--
Jazz is not dead. It just smells funny...
More information about the linux-arm-kernel
mailing list