diff mbox series

[v2,11/11] cpufreq: scmi: Drop redundant ifdef in scmi_cpufreq_probe()

Message ID 20230713141738.23970-12-ulf.hansson@linaro.org
State Superseded
Headers show
Series arm_scmi/cpufreq: Add generic performance scaling support | expand

Commit Message

Ulf Hansson July 13, 2023, 2:17 p.m. UTC
We have stubs for devm_of_clk_add_hw_provider(), so there should be no need
to protect this with the '#ifdef CONFIG_COMMON_CLK'. Let's drop it to clean
up the code a bit.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

Changes in v2:
	- New patch.

---

 drivers/cpufreq/scmi-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Sudeep Holla July 19, 2023, 3:32 p.m. UTC | #1
On Thu, Jul 13, 2023 at 04:17:38PM +0200, Ulf Hansson wrote:
> We have stubs for devm_of_clk_add_hw_provider(), so there should be no need
> to protect this with the '#ifdef CONFIG_COMMON_CLK'. Let's drop it to clean
> up the code a bit.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> 
> Changes in v2:
> 	- New patch.
> 
> ---
> 
>  drivers/cpufreq/scmi-cpufreq.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
> index b42f43d9bd89..ab967e520355 100644
> --- a/drivers/cpufreq/scmi-cpufreq.c
> +++ b/drivers/cpufreq/scmi-cpufreq.c
> @@ -326,11 +326,9 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev)
>  	if (IS_ERR(perf_ops))
>  		return PTR_ERR(perf_ops);
>  
> -#ifdef CONFIG_COMMON_CLK

I am not sure if it is no longer possible but at the time of addition of this
it was possible to build with CONFIG_COMMON_CLK=n and any error was reported[1]
I didn't want to add Kconfig dependency as this driver doesn't use any other
clock apis and this was added to meet some OPP(?) requirement IIRC. We can
drop the call to devm_of_clk_add_hw_provider if that is not the case. I need
to check it again as I can't recall all the details right now.

--
Regards,
Sudeep

[1] https://www.uwsg.indiana.edu/hypermail/linux/kernel/2012.0/04953.html
diff mbox series

Patch

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index b42f43d9bd89..ab967e520355 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -326,11 +326,9 @@  static int scmi_cpufreq_probe(struct scmi_device *sdev)
 	if (IS_ERR(perf_ops))
 		return PTR_ERR(perf_ops);
 
-#ifdef CONFIG_COMMON_CLK
 	/* dummy clock provider as needed by OPP if clocks property is used */
 	if (of_property_present(dev->of_node, "#clock-cells"))
 		devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
-#endif
 
 	ret = cpufreq_register_driver(&scmi_cpufreq_driver);
 	if (ret) {