public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
* [PATCH] clk: scpi: pass child node to of_clk_del_provider() in remove
@ 2026-05-13  9:09 Stepan Ionichev
  2026-05-17 11:47 ` Sudeep Holla
  0 siblings, 1 reply; 2+ messages in thread
From: Stepan Ionichev @ 2026-05-13  9:09 UTC (permalink / raw)
  To: sudeep.holla
  Cc: cristian.marussi, mturquette, sboyd, arm-scmi, linux-arm-kernel,
	linux-clk, linux-kernel, sozdayvek

scpi_clocks_remove() iterates over the SCPI clock provider's child
device nodes, but passes the parent node to of_clk_del_provider()
on every iteration:

	for_each_available_child_of_node(np, child)
		of_clk_del_provider(np);

Providers are registered per-child in scpi_clk_add() (via
of_clk_add_hw_provider(np, ...) where the np argument is the
child node passed in from probe). of_clk_del_provider() looks up
the entry by node equality, so a call with the parent never
matches and silently does nothing.

This leaks the struct of_clk_provider allocations and the
of_node_get() references the helper takes for every registered
child, both on module unload and on the probe error path
(scpi_clk_add() failure for child N leaves children 0..N-1
registered).

Pass child to of_clk_del_provider() instead, matching the
pattern used by clk-stm32mp1.c:2350-2351.

Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Control Processor)")
Signed-off-by: Stepan Ionichev <sozdayvek@gmail•com>
---
 drivers/clk/clk-scpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 7806569cd..24cee7c9f 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -258,7 +258,7 @@ static void scpi_clocks_remove(struct platform_device *pdev)
 	}
 
 	for_each_available_child_of_node(np, child)
-		of_clk_del_provider(np);
+		of_clk_del_provider(child);
 }
 
 static int scpi_clocks_probe(struct platform_device *pdev)
-- 
2.43.0



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

* Re: [PATCH] clk: scpi: pass child node to of_clk_del_provider() in remove
  2026-05-13  9:09 [PATCH] clk: scpi: pass child node to of_clk_del_provider() in remove Stepan Ionichev
@ 2026-05-17 11:47 ` Sudeep Holla
  0 siblings, 0 replies; 2+ messages in thread
From: Sudeep Holla @ 2026-05-17 11:47 UTC (permalink / raw)
  To: Stepan Ionichev
  Cc: Sudeep Holla, cristian.marussi, mturquette, sboyd, arm-scmi,
	linux-arm-kernel, linux-clk, linux-kernel

On Wed, 13 May 2026 14:09:00 +0500, Stepan Ionichev wrote:
> scpi_clocks_remove() iterates over the SCPI clock provider's child
> device nodes, but passes the parent node to of_clk_del_provider()
> on every iteration:
> 
> 	for_each_available_child_of_node(np, child)
> 		of_clk_del_provider(np);
> 
> [...]

Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!

[1/1] clk: scpi: pass child node to of_clk_del_provider() in remove
      https://git.kernel.org/sudeep.holla/c/b79d9b5747d9
--
Regards,
Sudeep



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

end of thread, other threads:[~2026-05-17 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13  9:09 [PATCH] clk: scpi: pass child node to of_clk_del_provider() in remove Stepan Ionichev
2026-05-17 11:47 ` Sudeep Holla

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