cpufreq: scmi: add COMMON_CLK dependency
PATCH 1/1 cpufreq: scmi: add COMMON_CLK dependency
From: Arnd Bergmann <[email protected]>
Wtihout CONFIG_COMMON_CLK, the scmi driver fails to link:
arm-linux-gnueabi-ld: drivers/cpufreq/scmi-cpufreq.o: in function `scmi_cpufreq_probe':
scmi-cpufreq.c:(.text+0x20c): undefined reference to `devm_of_clk_add_hw_provider'
arm-linux-gnueabi-ld: scmi-cpufreq.c:(.text+0x22c): undefined reference to `of_clk_hw_simple_get'
Add a Kconfig dependency for it.
--- drivers/cpufreq/Kconfig.arm | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +1 -0
@@ -264,6 +264,7 @@ config ARM_SA1110_CPUFREQ config ARM_SCMI_CPUFREQ tristate "SCMI based CPUfreq driver" depends on ARM_SCMI_PROTOCOL || COMPILE_TEST + depends on COMMON_CLK select PM_OPP help This adds the CPUfreq driver support for ARM platforms using SCMI
Signature · 1 line
2.27.0
Quoted 10 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Wtihout
CONFIG_COMMON_CLK, the scmi driver fails to link:arm-linux-gnueabi-ld:
drivers/cpufreq/scmi-cpufreq.o: in function `scmi_cpufreq_probe':
scmi-cpufreq.c:(.text+0x20c): undefined reference to `devm_of_clk_add_hw_provider'
arm-linux-gnueabi-ld: scmi-cpufreq.c:(.text+0x22c): undefined reference to `of_clk_hw_simple_get'Add a
Kconfigdependency for it.
There is a fix already upstream in later -rc(rc6 IIRC), I assume you are seeing this prior to that.
Commit f943849f7206 ("cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK")
Since the only dependency on CONFIG_COMMON_CLK is to satisfy OPP adding dummy clock provider, I avoided adding dependency on CLK for this driver as this works fine for !CONFIG_COMMON_CLK.
--
Regards,
Sudeep
P.S: There are 2 copies of this patch, I chose to reply on this, other one is @[1]
Quoted 10 lines · Sudeep Holla
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Wtihout
CONFIG_COMMON_CLK, the scmi driver fails to link:arm-linux-gnueabi-ld:
drivers/cpufreq/scmi-cpufreq.o: in function `scmi_cpufreq_probe':
scmi-cpufreq.c:(.text+0x20c): undefined reference to `devm_of_clk_add_hw_provider'
arm-linux-gnueabi-ld: scmi-cpufreq.c:(.text+0x22c): undefined reference to `of_clk_hw_simple_get'
Quoted 7 lines
Quoted 2 lines
Add a
Kconfigdependency for it.There is a fix already upstream in later -rc(rc6 IIRC), I assume you are seeing this prior to that.
Commit
f943849f7206("cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK")
Ok, I missed that during my rebase.
Quoted 3 lines
Since the only dependency on
CONFIG_COMMON_CLKis to satisfy OPP adding dummy clock provider, I avoided adding dependency on CLK for this driver as this works fine for !CONFIG_COMMON_CLK.
Right. I don't think it makes much difference either way, though I usually prefer code checks to be written as
/* dummy clock provider as needed by OPP if clocks property is used */
if (IS_ENABLED(CONFIG_COMMON_CLK) &&
of_find_property(dev->of_node, "#clock-cells", NULL))
devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);which helps readability as well as compile coverage. Doesn't matter here either, since there are only two lines inside.
Arnd