cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK
authorSudeep Holla <sudeep.holla@arm.com>
Fri, 20 Nov 2020 10:12:52 +0000 (10:12 +0000)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Nov 2020 04:45:56 +0000 (10:15 +0530)
commitf943849f720689214abb3930623c31ff91990be9
tree49e7365b960f622d13f357287722a4c8e2417ebf
parent8410e7f3b31e53bfa7a34c282b4313e79ed7ff8d
cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK

Commit 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a
dummy clock provider") registers a dummy clock provider using
devm_of_clk_add_hw_provider. These *_hw_provider functions are defined
only when CONFIG_COMMON_CLK=y. One possible fix is to add the Kconfig
dependency, but since we plan to move away from the clock dependency
for scmi cpufreq, it is preferrable to avoid that.

Let us just conditionally compile out the offending call to
devm_of_clk_add_hw_provider. It also uses the variable 'dev' outside
of the #ifdef block to avoid build warning.

Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/scmi-cpufreq.c