cpufreq: exynos: allow modular build
authorArnd Bergmann <arnd@arndb.de>
Sat, 31 Jan 2015 18:35:18 +0000 (14:35 -0400)
committerEduardo Valentin <edubezval@gmail.com>
Sat, 31 Jan 2015 18:56:27 +0000 (14:56 -0400)
commit8b2b4a4e5366341d0d93607a3e035ced5fb918e6
tree09f112c8b9cb798e550cc56f69e4cd2620bc9c6a
parent252454f5cbda2c6b40c5d36f58cac2938437b85d
cpufreq: exynos: allow modular build

The exynos cpufreq driver code recently gained a dependency on the
cooling code, which may be a loadable module. This breaks an ARM
allmodconfig build:

drivers/built-in.o: In function `exynos_cpufreq_probe':
:(.text+0x1748e8): undefined reference to `of_cpufreq_cooling_register'

To avoid this problem, change cpufreq Kconfig to allow the drivers
to be loadable modules as well and enforce a dependency on the
thermal module.

This change, in order to allow module builds on this cpufreq
driver, properly constructs the driver into a single module,
instead of several modules. The change also keeps the proper
platform dependency, and therefore, it wont load in platforms
that are not supposed to be loaded. The user will be able to
build the support for all platforms, or select which platforms
(s)he wants (as originally), except that now it can be a module,
instead.

Besides, it will still keep the driver only on those configs
that expect it to be on. And it won't compile/load on platforms
that it is not supposed to. It brings the config ARM_EXYNOS_CPU_FREQ_BOOST_SW
closer to this driver, so it looks better in the menuconfig.

We intentionally change ARM_EXYNOS5440_CPUFREQ to be tristate too, to
avoid future troubles.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-pm@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Fixes: e725d26c4857 ("cpufreq: exynos: Use device tree to determine if cpufreq cooling should be registered")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/cpufreq/Kconfig.arm
drivers/cpufreq/Makefile