[PATCH v2 5/5] clk: en7523: populate SCU child devices

From: John Crispin

Date: Tue Dec 01 2026 - 14:37:38 EST


The AN7583 and AN7589 MDIO controllers sit in the SCU register space
and are described as children of the clock controller node, but nothing
creates their platform devices. Populate the children once the clock
and reset providers are registered, since they consume both. SoCs
without child nodes are not affected.

While at it, switch to devm_of_clk_add_hw_provider() so the provider
does not stay registered if populating the children fails.

Signed-off-by: John Crispin <john@xxxxxxxxxxx>
---
v2: rebased, reworded the commit message

drivers/clk/clk-en7523.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
index 775caa54d89c..195b33f010fa 100644
--- a/drivers/clk/clk-en7523.c
+++ b/drivers/clk/clk-en7523.c
@@ -5,6 +5,7 @@
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>
+#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/phy/phy.h>
@@ -2106,7 +2107,6 @@ static int en751221_clk_hw_init(struct platform_device *pdev,

static int en7523_clk_probe(struct platform_device *pdev)
{
- struct device_node *node = pdev->dev.of_node;
const struct en_clk_soc_data *soc_data;
struct clk_hw_onecell_data *clk_data;
struct en_clk_priv *priv;
@@ -2133,7 +2133,12 @@ static int en7523_clk_probe(struct platform_device *pdev)
if (r)
return r;

- return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
+ r = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_onecell_get,
+ clk_data);
+ if (r)
+ return r;
+
+ return devm_of_platform_populate(&pdev->dev);
}

static const struct en_clk_soc_data en7523_data = {
--
2.34.1