cpufreq: SPEAr: Instantiate as platform_driver

As multiplatform build is being adopted by more and more
ARM platforms, initcall function should be used very carefully.
For example, when SPEAr cpufreq driver is enabled on a kernel
booted on a non-SPEAr board, we will get following boot time error:

	spear_cpufreq: Invalid cpufreq_tbl

To eliminate this undesired the effect, the patch changes SPEAr
driver to have it instantiated as a platform_driver. Then it will
only run on platforms that create the platform_device "spear-cpufreq".

This patch also creates platform node for SPEAr13xx boards.

Reported-by: Josh Cartwright <joshc@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Цей коміт міститься в:
Viresh Kumar
2014-03-10 15:43:18 +05:30
зафіксовано Rafael J. Wysocki
джерело 96bbbe4a2a
коміт 2449d33a40
3 змінених файлів з 13 додано та 2 видалено

Переглянути файл

@@ -28,6 +28,7 @@
static void __init spear1310_dt_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
}
static const char * const spear1310_dt_board_compat[] = {

Переглянути файл

@@ -143,6 +143,7 @@ static void __init spear1340_dt_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table,
spear1340_auxdata_lookup, NULL);
platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
}
static const char * const spear1340_dt_board_compat[] = {