Skip to contentSkip to conversation

cpufreq: airoha: add CONFIG_OF dependency

PATCH Applied Arnd Bergmann 3 participants 5 messages Jan 22, 2025 – Feb 3, 2025 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: airoha: add CONFIG_OF dependency

From: Arnd Bergmann <[email protected]>

Compile-testing without CONFIG_OF leads to a harmless build warning:

drivers/cpufreq/airoha-cpufreq.c:109:34: error: 'airoha_cpufreq_match_list' defined but not used [-Werror=unused-const-variable=]

  109 | static const struct of_device_id airoha_cpufreq_match_list[] __initconst = {
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~

It would be possible to mark the variable as __maybe_unused to shut up that warning, but a Kconfig dependency seems more appropriate as this still allows build testing in allmodconfig and randconfig builds on all architectures.

Fixes 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
---
 drivers/cpufreq/Kconfig.arm | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +1 -0
index 704e84d00639..9e46960f6a86 100644
@@ -18,6 +18,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 config ARM_AIROHA_SOC_CPUFREQ
 	tristate "Airoha EN7581 SoC CPUFreq support"
 	depends on ARCH_AIROHA || COMPILE_TEST
+	depends on OF
 	select PM_OPP
 	default ARCH_AIROHA
 	help
Signature · 1 line
2.39.5
maintainer Applied
#1 lore raw
Quoted 24 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Compile-testing without CONFIG_OF leads to a harmless build warning:

drivers/cpufreq/airoha-cpufreq.c:109:34: error: 'airoha_cpufreq_match_list' defined but not used [-Werror=unused-const-variable=]

  109 | static const struct of_device_id airoha_cpufreq_match_list[] __initconst = {
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~

It would be possible to mark the variable as __maybe_unused to shut up that warning, but a Kconfig dependency seems more appropriate as this still allows build testing in allmodconfig and randconfig builds on all architectures.

Fixes 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
---
 drivers/cpufreq/Kconfig.arm | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +0 -0
index 704e84d00639..9e46960f6a86 100644

drivers/cpufreq/Kconfig.arm config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM · line 24

Quoted 7 lines
drivers/cpufreq/Kconfig.arm +1 -0
@@ -18,6 +18,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 config ARM_AIROHA_SOC_CPUFREQ
 	tristate "Airoha EN7581 SoC CPUFreq support"
 	depends on ARCH_AIROHA || COMPILE_TEST
+	depends on OF
 	select PM_OPP
 	default ARCH_AIROHA
 	help

Applied. Thanks.

Signature · 1 line
viresh
#2 lore raw
Quoted 16 lines · Viresh Kumar

drivers/cpufreq/Kconfig.arm config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM · line 24

Quoted 13 lines
drivers/cpufreq/Kconfig.arm +1 -0
index 704e84d00639..9e46960f6a86 100644
@@ -18,6 +18,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 config ARM_AIROHA_SOC_CPUFREQ
 	tristate "Airoha EN7581 SoC CPUFreq support"
 	depends on ARCH_AIROHA || COMPILE_TEST
+	depends on OF
 	select PM_OPP
 	default ARCH_AIROHA
 	help

Applied. Thanks.

It appears that something went wrong when you applied the fix, the version that is in your tree now makes no sense:

drivers/cpufreq/Kconfig.arm +1 -1
@@ -17,7 +17,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 
 config ARM_AIROHA_SOC_CPUFREQ
        tristate "Airoha EN7581 SoC CPUFreq support"
-       depends on ARCH_AIROHA || COMPILE_TEST
+       depends on (ARCH_AIROHA && OF) || COMPILE_TEST
        select PM_OPP
        default ARCH_AIROHA
        help

ARCH_AIROHA requires CONFIG_OF, so this change does nothing, and the dependency is still missing for the COMPILE_TEST case.

Arnd

maintainer
#3 lore raw
Quoted 18 lines · Arnd Bergmann
Quoted 16 lines · Viresh Kumar

drivers/cpufreq/Kconfig.arm config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM · line 24

Quoted 13 lines
drivers/cpufreq/Kconfig.arm +1 -0
index 704e84d00639..9e46960f6a86 100644
@@ -18,6 +18,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 config ARM_AIROHA_SOC_CPUFREQ
 	tristate "Airoha EN7581 SoC CPUFreq support"
 	depends on ARCH_AIROHA || COMPILE_TEST
+	depends on OF
 	select PM_OPP
 	default ARCH_AIROHA
 	help

Applied. Thanks.

Quoted 2 lines

It appears that something went wrong when you applied the fix, the version that is in your tree now makes no sense:

Not just that, I actually fixed the problem by myself and so the commit doesn't have your credentials. I somehow managed to do two stupid things:

- Lost your original commit, which I have surely applied as I replied to you earlier (and I reply only after I apply a patch).

- Reinvented the wheel, that too incorrectly /facepalm .

Quoted 12 lines
drivers/cpufreq/Kconfig.arm +1 -1
@@ -17,7 +17,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 
 config ARM_AIROHA_SOC_CPUFREQ
        tristate "Airoha EN7581 SoC CPUFreq support"
-       depends on ARCH_AIROHA || COMPILE_TEST
+       depends on (ARCH_AIROHA && OF) || COMPILE_TEST
        select PM_OPP
        default ARCH_AIROHA
        help
Quoted 2 lines

ARCH_AIROHA requires CONFIG_OF, so this change does nothing, and the dependency is still missing for the COMPILE_TEST case.

Going to send this patch now, lemme know if it looks okay:

commit 9d51d2710061dfa7f2568287c6ed125b858b7318 (HEAD -> cpufreq/arm/linux-next)

Author: Arnd Bergmann <[email protected]>
Date:   Wed Jan 22 07:55:01 2025 +0100

cpufreq: airoha: modify CONFIG_OF dependency

Compile-testing without CONFIG_OF leads to a harmless build warning:

drivers/cpufreq/airoha-cpufreq.c:109:34: error: 'airoha_cpufreq_match_list' defined but not used [-Werror=unused-const-variable=]
109 | static const struct of_device_id airoha_cpufreq_match_list[] __initconst = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~

It would be possible to mark the variable as __maybe_unused to shut up that warning, but a Kconfig dependency seems more appropriate as this still allows build testing in allmodconfig and randconfig builds on all architectures.

An earlier commit, b865a8404642 ("cpufreq: airoha: Depends on OF"), tried to fix it incorrectly. ARCH_AIROHA already requires CONFIG_OF, so this change does nothing, and the dependency is still missing for the COMPILE_TEST case.

Fix it properly.

Fixes 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
Fixes b865a8404642 ("cpufreq: airoha: Depends on OF")
[ Viresh: updated commit log and fixed rebase conflict ]
---
 drivers/cpufreq/Kconfig.arm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/cpufreq/Kconfig.arm +2 -1
index 0ee5c691fb36..9e46960f6a86 100644
@@ -17,7 +17,8 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
 
 config ARM_AIROHA_SOC_CPUFREQ
        tristate "Airoha EN7581 SoC CPUFreq support"
-       depends on (ARCH_AIROHA && OF) || COMPILE_TEST
+       depends on ARCH_AIROHA || COMPILE_TEST
+       depends on OF
        select PM_OPP
        default ARCH_AIROHA
        help
Signature · 1 line
viresh
#4 lore raw
Quoted 14 lines · Viresh Kumar

Going to send this patch now, lemme know if it looks okay:

It would be possible to mark the variable as __maybe_unused to shut up that warning, but a Kconfig dependency seems more appropriate as this still allows build testing in allmodconfig and randconfig builds on all architectures.

An earlier commit, b865a8404642 ("cpufreq: airoha: Depends on OF"), tried to fix it incorrectly. ARCH_AIROHA already requires CONFIG_OF, so this change does nothing, and the dependency is still missing for the COMPILE_TEST case.

Quoted 7 lines

Fix it properly.

Fixes 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
Fixes b865a8404642 ("cpufreq: airoha: Depends on OF")
[ Viresh: updated commit log and fixed rebase conflict ]

Looks good to me, thanks!

Arnd