Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver
@ 2025-12-14 23:29 Inochi Amaoto
  2025-12-15  2:54 ` Troy Mitchell
  2025-12-15 22:12 ` Yixun Lan
  0 siblings, 2 replies; 6+ messages in thread
From: Inochi Amaoto @ 2025-12-14 23:29 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Yixun Lan, Haylen Chu,
	Inochi Amaoto, Brian Masney, Troy Mitchell, Alex Elder,
	Akhilesh Patil
  Cc: linux-clk, linux-riscv, spacemit, linux-kernel, Longbin Li

For build spacemit common clock driver as a module, the build
process require MODULE_LICENSE()/MODULE_DESCRIPTION() globally
and EXPORT_SYMBOL() for every exposed symbol. Otherwise, the
build will fail.

Add these missing hints, so the driver can be built as a module.

Fixes: 1b72c59db0ad ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 drivers/clk/spacemit/ccu_ddn.c | 1 +
 drivers/clk/spacemit/ccu_mix.c | 9 +++++++++
 drivers/clk/spacemit/ccu_pll.c | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/drivers/clk/spacemit/ccu_ddn.c b/drivers/clk/spacemit/ccu_ddn.c
index 5b16e273bee5..9b6dc6910284 100644
--- a/drivers/clk/spacemit/ccu_ddn.c
+++ b/drivers/clk/spacemit/ccu_ddn.c
@@ -84,3 +84,4 @@ const struct clk_ops spacemit_ccu_ddn_ops = {
 	.determine_rate = ccu_ddn_determine_rate,
 	.set_rate	= ccu_ddn_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_ddn_ops);
diff --git a/drivers/clk/spacemit/ccu_mix.c b/drivers/clk/spacemit/ccu_mix.c
index 7b7990875372..09f377a6a4f5 100644
--- a/drivers/clk/spacemit/ccu_mix.c
+++ b/drivers/clk/spacemit/ccu_mix.c
@@ -198,24 +198,28 @@ const struct clk_ops spacemit_ccu_gate_ops = {
 	.enable		= ccu_gate_enable,
 	.is_enabled	= ccu_gate_is_enabled,
 };
+EXPORT_SYMBOL(spacemit_ccu_gate_ops);
 
 const struct clk_ops spacemit_ccu_factor_ops = {
 	.determine_rate = ccu_factor_determine_rate,
 	.recalc_rate	= ccu_factor_recalc_rate,
 	.set_rate	= ccu_factor_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_factor_ops);
 
 const struct clk_ops spacemit_ccu_mux_ops = {
 	.determine_rate = ccu_mix_determine_rate,
 	.get_parent	= ccu_mux_get_parent,
 	.set_parent	= ccu_mux_set_parent,
 };
+EXPORT_SYMBOL(spacemit_ccu_mux_ops);
 
 const struct clk_ops spacemit_ccu_div_ops = {
 	.determine_rate = ccu_mix_determine_rate,
 	.recalc_rate	= ccu_div_recalc_rate,
 	.set_rate	= ccu_mix_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_div_ops);
 
 const struct clk_ops spacemit_ccu_factor_gate_ops = {
 	.disable	= ccu_gate_disable,
@@ -226,6 +230,7 @@ const struct clk_ops spacemit_ccu_factor_gate_ops = {
 	.recalc_rate	= ccu_factor_recalc_rate,
 	.set_rate	= ccu_factor_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_factor_gate_ops);
 
 const struct clk_ops spacemit_ccu_mux_gate_ops = {
 	.disable	= ccu_gate_disable,
@@ -236,6 +241,7 @@ const struct clk_ops spacemit_ccu_mux_gate_ops = {
 	.get_parent	= ccu_mux_get_parent,
 	.set_parent	= ccu_mux_set_parent,
 };
+EXPORT_SYMBOL(spacemit_ccu_mux_gate_ops);
 
 const struct clk_ops spacemit_ccu_div_gate_ops = {
 	.disable	= ccu_gate_disable,
@@ -246,6 +252,7 @@ const struct clk_ops spacemit_ccu_div_gate_ops = {
 	.recalc_rate	= ccu_div_recalc_rate,
 	.set_rate	= ccu_mix_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_div_gate_ops);
 
 const struct clk_ops spacemit_ccu_mux_div_gate_ops = {
 	.disable	= ccu_gate_disable,
@@ -259,6 +266,7 @@ const struct clk_ops spacemit_ccu_mux_div_gate_ops = {
 	.recalc_rate	= ccu_div_recalc_rate,
 	.set_rate	= ccu_mix_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_mux_div_gate_ops);
 
 const struct clk_ops spacemit_ccu_mux_div_ops = {
 	.get_parent	= ccu_mux_get_parent,
@@ -268,3 +276,4 @@ const struct clk_ops spacemit_ccu_mux_div_ops = {
 	.recalc_rate	= ccu_div_recalc_rate,
 	.set_rate	= ccu_mix_set_rate,
 };
+EXPORT_SYMBOL(spacemit_ccu_mux_div_ops);
diff --git a/drivers/clk/spacemit/ccu_pll.c b/drivers/clk/spacemit/ccu_pll.c
index d92f0dae65a4..f8fc53887189 100644
--- a/drivers/clk/spacemit/ccu_pll.c
+++ b/drivers/clk/spacemit/ccu_pll.c
@@ -7,6 +7,7 @@
 #include <linux/clk-provider.h>
 #include <linux/math.h>
 #include <linux/regmap.h>
+#include <linux/module.h>
 
 #include "ccu_common.h"
 #include "ccu_pll.h"
@@ -157,3 +158,7 @@ const struct clk_ops spacemit_ccu_pll_ops = {
 	.determine_rate = ccu_pll_determine_rate,
 	.is_enabled	= ccu_pll_is_enabled,
 };
+EXPORT_SYMBOL(spacemit_ccu_pll_ops);
+
+MODULE_DESCRIPTION("SpacemiT CCU PLL/MIX/DDN common driver");
+MODULE_LICENSE("GPL");
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver
  2025-12-14 23:29 [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver Inochi Amaoto
@ 2025-12-15  2:54 ` Troy Mitchell
  2025-12-15 22:18   ` Yixun Lan
  2025-12-15 22:12 ` Yixun Lan
  1 sibling, 1 reply; 6+ messages in thread
From: Troy Mitchell @ 2025-12-15  2:54 UTC (permalink / raw)
  To: Inochi Amaoto, Michael Turquette, Stephen Boyd, Yixun Lan,
	Haylen Chu, Brian Masney, Troy Mitchell, Alex Elder,
	Akhilesh Patil
  Cc: linux-clk, linux-riscv, spacemit, linux-kernel, Longbin Li

On Mon, Dec 15, 2025 at 07:29:37AM +0800, Inochi Amaoto wrote:
> For build spacemit common clock driver as a module, the build
> process require MODULE_LICENSE()/MODULE_DESCRIPTION() globally
> and EXPORT_SYMBOL() for every exposed symbol. Otherwise, the
> build will fail.
> 
> Add these missing hints, so the driver can be built as a module.
> 
> Fixes: 1b72c59db0ad ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Thanks.

Acked-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver
  2025-12-14 23:29 [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver Inochi Amaoto
  2025-12-15  2:54 ` Troy Mitchell
@ 2025-12-15 22:12 ` Yixun Lan
  2025-12-16 14:48   ` Yixun Lan
  1 sibling, 1 reply; 6+ messages in thread
From: Yixun Lan @ 2025-12-15 22:12 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Michael Turquette, Stephen Boyd, Haylen Chu, Brian Masney,
	Troy Mitchell, Alex Elder, Akhilesh Patil, linux-clk, linux-riscv,
	spacemit, linux-kernel, Longbin Li

Hi Inochi,

On 07:29 Mon 15 Dec     , Inochi Amaoto wrote:
> For build spacemit common clock driver as a module, the build
> process require MODULE_LICENSE()/MODULE_DESCRIPTION() globally
> and EXPORT_SYMBOL() for every exposed symbol. Otherwise, the
> build will fail.
> 
> Add these missing hints, so the driver can be built as a module.
> 
> Fixes: 1b72c59db0ad ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
looks good, thanks

Reviewed-by: Yixun Lan <dlan@gentoo.org>

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver
  2025-12-15  2:54 ` Troy Mitchell
@ 2025-12-15 22:18   ` Yixun Lan
  0 siblings, 0 replies; 6+ messages in thread
From: Yixun Lan @ 2025-12-15 22:18 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Inochi Amaoto, Michael Turquette, Stephen Boyd, Haylen Chu,
	Brian Masney, Alex Elder, Akhilesh Patil, linux-clk, linux-riscv,
	spacemit, linux-kernel, Longbin Li

Hi Troy,

On 10:54 Mon 15 Dec     , Troy Mitchell wrote:
> On Mon, Dec 15, 2025 at 07:29:37AM +0800, Inochi Amaoto wrote:
> > For build spacemit common clock driver as a module, the build
> > process require MODULE_LICENSE()/MODULE_DESCRIPTION() globally
> > and EXPORT_SYMBOL() for every exposed symbol. Otherwise, the
> > build will fail.
> > 
> > Add these missing hints, so the driver can be built as a module.
> > 
> > Fixes: 1b72c59db0ad ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> Thanks.
> 
> Acked-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>

I think it's more proper to use reviewed-by here, for acked-by, it's
up to subsystem maintainer or original patch author for signifying
explict agreement or acceptance of patch inclusion..

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver
  2025-12-15 22:12 ` Yixun Lan
@ 2025-12-16 14:48   ` Yixun Lan
  2025-12-16 22:47     ` Inochi Amaoto
  0 siblings, 1 reply; 6+ messages in thread
From: Yixun Lan @ 2025-12-16 14:48 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Michael Turquette, Stephen Boyd, Haylen Chu, Brian Masney,
	Troy Mitchell, Alex Elder, Akhilesh Patil, linux-clk, linux-riscv,
	spacemit, linux-kernel, Longbin Li

Hi

On 06:12 Tue 16 Dec     , Yixun Lan wrote:
> Hi Inochi,
> 
> On 07:29 Mon 15 Dec     , Inochi Amaoto wrote:
> > For build spacemit common clock driver as a module, the build
> > process require MODULE_LICENSE()/MODULE_DESCRIPTION() globally
> > and EXPORT_SYMBOL() for every exposed symbol. Otherwise, the
> > build will fail.
> > 
> > Add these missing hints, so the driver can be built as a module.
> > 
> > Fixes: 1b72c59db0ad ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> looks good, thanks
> 
> Reviewed-by: Yixun Lan <dlan@gentoo.org>
> 
On my second thought, since all functions only used in spacemit clock
driver, how about using symbol namespaces? please refer the doc

https://www.kernel.org/doc/Documentation/kbuild/namespaces.rst

or check drivers/clk/meson/ for example..

-- 
Yixun Lan (dlan)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver
  2025-12-16 14:48   ` Yixun Lan
@ 2025-12-16 22:47     ` Inochi Amaoto
  0 siblings, 0 replies; 6+ messages in thread
From: Inochi Amaoto @ 2025-12-16 22:47 UTC (permalink / raw)
  To: Yixun Lan, Inochi Amaoto
  Cc: Michael Turquette, Stephen Boyd, Haylen Chu, Brian Masney,
	Troy Mitchell, Alex Elder, Akhilesh Patil, linux-clk, linux-riscv,
	spacemit, linux-kernel, Longbin Li

On Tue, Dec 16, 2025 at 10:48:45PM +0800, Yixun Lan wrote:
> Hi
> 
> On 06:12 Tue 16 Dec     , Yixun Lan wrote:
> > Hi Inochi,
> > 
> > On 07:29 Mon 15 Dec     , Inochi Amaoto wrote:
> > > For build spacemit common clock driver as a module, the build
> > > process require MODULE_LICENSE()/MODULE_DESCRIPTION() globally
> > > and EXPORT_SYMBOL() for every exposed symbol. Otherwise, the
> > > build will fail.
> > > 
> > > Add these missing hints, so the driver can be built as a module.
> > > 
> > > Fixes: 1b72c59db0ad ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
> > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > looks good, thanks
> > 
> > Reviewed-by: Yixun Lan <dlan@gentoo.org>
> > 
> On my second thought, since all functions only used in spacemit clock
> driver, how about using symbol namespaces? please refer the doc
> 
> https://www.kernel.org/doc/Documentation/kbuild/namespaces.rst
> 
> or check drivers/clk/meson/ for example..
> 
> -- 
> Yixun Lan (dlan)

Good to know, I will change this in the v2.

Regards,
Inochi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-12-16 22:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-14 23:29 [PATCH] clk: spacemit: Fix module build for spacemit common ccu driver Inochi Amaoto
2025-12-15  2:54 ` Troy Mitchell
2025-12-15 22:18   ` Yixun Lan
2025-12-15 22:12 ` Yixun Lan
2025-12-16 14:48   ` Yixun Lan
2025-12-16 22:47     ` Inochi Amaoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox