Devicetree
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@kernel.org>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Vitaliy Sochnev <sochnev.v.74@gmail.com>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Felix Fietkau <nbd@nbd.name>,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, lei.dong@airoha.com,
	Linqi.zhang@airoha.com, Rajeev.kumar@airoha.com,
	upstream@airoha.com, Weifeng.xu@airoha.com,
	zhengping.zhang@airoha.com
Subject: [PATCH v2 5/5] clk: en7523: populate SCU child devices
Date: Tue,  1 Dec 2026 20:36:57 +0100	[thread overview]
Message-ID: <20261201193657.3072138-6-john@phrozen.org> (raw)
In-Reply-To: <20261201193657.3072138-1-john@phrozen.org>

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@phrozen.org>
---
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


      parent reply	other threads:[~2026-12-01 19:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 19:36 [PATCH v2 0/5] clk: en7523: add support for Airoha AN7589 John Crispin
2026-12-01 19:36 ` [PATCH v2 1/5] dt-bindings: arm: airoha: add AN7589 chip SCU John Crispin
2026-12-01 19:36 ` [PATCH v2 2/5] dt-bindings: clock: airoha: add AN7589 John Crispin
2026-12-01 19:36 ` [PATCH v2 3/5] clk: en7523: add support for Airoha AN7589 John Crispin
2026-12-01 19:36 ` [PATCH v2 4/5] dt-bindings: clock: airoha: allow MDIO controllers under the SCU John Crispin
2026-12-01 19:36 ` John Crispin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201193657.3072138-6-john@phrozen.org \
    --to=john@phrozen.org \
    --cc=Linqi.zhang@airoha.com \
    --cc=Rajeev.kumar@airoha.com \
    --cc=Weifeng.xu@airoha.com \
    --cc=ansuelsmth@gmail.com \
    --cc=bmasney+clk@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lei.dong@airoha.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sochnev.v.74@gmail.com \
    --cc=upstream@airoha.com \
    --cc=zhengping.zhang@airoha.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox