Skip to content

Commit f943849

Browse files
sudeep-hollavireshk
authored andcommitted
cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK
Commit 8410e7f ("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: 8410e7f ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider") Cc: Rafael J. Wysocki <[email protected]> Cc: Viresh Kumar <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 8410e7f commit f943849

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/cpufreq/scmi-cpufreq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,15 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev)
236236
if (!handle || !handle->perf_ops)
237237
return -ENODEV;
238238

239+
#ifdef CONFIG_COMMON_CLK
239240
/* dummy clock provider as needed by OPP if clocks property is used */
240241
if (of_find_property(dev->of_node, "#clock-cells", NULL))
241242
devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
243+
#endif
242244

243245
ret = cpufreq_register_driver(&scmi_cpufreq_driver);
244246
if (ret) {
245-
dev_err(&sdev->dev, "%s: registering cpufreq failed, err: %d\n",
247+
dev_err(dev, "%s: registering cpufreq failed, err: %d\n",
246248
__func__, ret);
247249
}
248250

0 commit comments

Comments
 (0)