public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: renesas: fix r9a09g057_cpg_info link error
@ 2024-08-07  7:56 Arnd Bergmann
  2024-08-07 20:52 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-08-07  7:56 UTC (permalink / raw)
  To: Geert Uytterhoeven, Lad Prabhakar
  Cc: Arnd Bergmann, Michael Turquette, Stephen Boyd, linux-renesas-soc,
	linux-clk, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The rzv2g-cpg.c driver unconditionally links into the r9a09g057
one, but that may be disabled:

aarch64-linux-ld: drivers/clk/renesas/rzv2h-cpg.o:(.rodata+0x440): undefined reference to `r9a09g057_cpg_info'

Use the same approach here as with the rzg2l variant, using an #ifdef
around tha data.

I think both drivers would be better off doing the abstraction the other
way round, with the platform_driver structure defined in the most specific
file and the common bits as a library that exports common functions.
Changing it that way would require a larger rework of course.

Fixes: 42b54d52ecb7 ("clk: renesas: Add RZ/V2H(P) CPG driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/clk/renesas/rzv2h-cpg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c
index bc0c3bbdb997..34221046dc46 100644
--- a/drivers/clk/renesas/rzv2h-cpg.c
+++ b/drivers/clk/renesas/rzv2h-cpg.c
@@ -664,10 +664,12 @@ static int __init rzv2h_cpg_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id rzv2h_cpg_match[] = {
+#ifdef CONFIG_CLK_R9A09G057
 	{
 		.compatible = "renesas,r9a09g057-cpg",
 		.data = &r9a09g057_cpg_info,
 	},
+#endif
 	{ /* sentinel */ }
 };
 
-- 
2.39.2


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

* Re: [PATCH] clk: renesas: fix r9a09g057_cpg_info link error
  2024-08-07  7:56 [PATCH] clk: renesas: fix r9a09g057_cpg_info link error Arnd Bergmann
@ 2024-08-07 20:52 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2024-08-07 20:52 UTC (permalink / raw)
  To: Arnd Bergmann, Geert Uytterhoeven, Lad Prabhakar
  Cc: Arnd Bergmann, Michael Turquette, linux-renesas-soc, linux-clk,
	linux-kernel

Quoting Arnd Bergmann (2024-08-07 00:56:58)
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The rzv2g-cpg.c driver unconditionally links into the r9a09g057
> one, but that may be disabled:
> 
> aarch64-linux-ld: drivers/clk/renesas/rzv2h-cpg.o:(.rodata+0x440): undefined reference to `r9a09g057_cpg_info'
> 
> Use the same approach here as with the rzg2l variant, using an #ifdef
> around tha data.
> 
> I think both drivers would be better off doing the abstraction the other
> way round, with the platform_driver structure defined in the most specific
> file and the common bits as a library that exports common functions.
> Changing it that way would require a larger rework of course.
> 
> Fixes: 42b54d52ecb7 ("clk: renesas: Add RZ/V2H(P) CPG driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

This is https://lore.kernel.org/r/20240805095842.277792-1-prabhakar.mahadev-lad.rj@bp.renesas.com

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

end of thread, other threads:[~2024-08-07 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07  7:56 [PATCH] clk: renesas: fix r9a09g057_cpg_info link error Arnd Bergmann
2024-08-07 20:52 ` Stephen Boyd

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