From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net-next 1/6] net: stmmac: move stmmac_bus_clks_config() to stmmac_platform.c
Date: Tue, 23 Sep 2025 12:25:59 +0100 [thread overview]
Message-ID: <E1v119j-0000000773s-1R2v@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aNKDqqI7aLsuDD52@shell.armlinux.org.uk>
stmmac_bus_clks_config() is only used by stmmac_platform.c, so rather
than having it in stmmac_main.c and needing to export the symbol,
move it to where it's used.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 -
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 33 -------------------
.../ethernet/stmicro/stmmac/stmmac_platform.c | 32 ++++++++++++++++++
3 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 151f08e5e85d..7ca5477be390 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -404,7 +404,6 @@ int stmmac_dvr_probe(struct device *device,
struct stmmac_resources *res);
int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt);
int stmmac_reinit_ringparam(struct net_device *dev, u32 rx_size, u32 tx_size);
-int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled);
int stmmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
phy_interface_t interface, int speed);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d17820d9e7f1..517b25b2bcae 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -147,39 +147,6 @@ static void stmmac_exit_fs(struct net_device *dev);
#define STMMAC_COAL_TIMER(x) (ns_to_ktime((x) * NSEC_PER_USEC))
-int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled)
-{
- struct plat_stmmacenet_data *plat_dat = priv->plat;
- int ret;
-
- if (enabled) {
- ret = clk_prepare_enable(plat_dat->stmmac_clk);
- if (ret)
- return ret;
- ret = clk_prepare_enable(plat_dat->pclk);
- if (ret) {
- clk_disable_unprepare(plat_dat->stmmac_clk);
- return ret;
- }
- if (plat_dat->clks_config) {
- ret = plat_dat->clks_config(plat_dat->bsp_priv, enabled);
- if (ret) {
- clk_disable_unprepare(plat_dat->stmmac_clk);
- clk_disable_unprepare(plat_dat->pclk);
- return ret;
- }
- }
- } else {
- clk_disable_unprepare(plat_dat->stmmac_clk);
- clk_disable_unprepare(plat_dat->pclk);
- if (plat_dat->clks_config)
- plat_dat->clks_config(plat_dat->bsp_priv, enabled);
- }
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(stmmac_bus_clks_config);
-
/**
* stmmac_set_clk_tx_rate() - set the clock rate for the MAC transmit clock
* @bsp_priv: BSP private data structure (unused)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 712ef235f0f4..27bcaae07a7f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -911,6 +911,38 @@ void stmmac_pltfr_remove(struct platform_device *pdev)
}
EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
+static int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled)
+{
+ struct plat_stmmacenet_data *plat_dat = priv->plat;
+ int ret;
+
+ if (enabled) {
+ ret = clk_prepare_enable(plat_dat->stmmac_clk);
+ if (ret)
+ return ret;
+ ret = clk_prepare_enable(plat_dat->pclk);
+ if (ret) {
+ clk_disable_unprepare(plat_dat->stmmac_clk);
+ return ret;
+ }
+ if (plat_dat->clks_config) {
+ ret = plat_dat->clks_config(plat_dat->bsp_priv, enabled);
+ if (ret) {
+ clk_disable_unprepare(plat_dat->stmmac_clk);
+ clk_disable_unprepare(plat_dat->pclk);
+ return ret;
+ }
+ }
+ } else {
+ clk_disable_unprepare(plat_dat->stmmac_clk);
+ clk_disable_unprepare(plat_dat->pclk);
+ if (plat_dat->clks_config)
+ plat_dat->clks_config(plat_dat->bsp_priv, enabled);
+ }
+
+ return 0;
+}
+
static int __maybe_unused stmmac_runtime_suspend(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
--
2.47.3
next prev parent reply other threads:[~2025-09-23 11:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 11:25 [PATCH net-next 0/6] net: stmmac: yet more cleanups Russell King (Oracle)
2025-09-23 11:25 ` Russell King (Oracle) [this message]
2025-09-23 11:26 ` [PATCH net-next 2/6] net: stmmac: move xpcs clause 73 test into stmmac_init_phy() Russell King (Oracle)
2025-09-23 11:26 ` [PATCH net-next 3/6] net: stmmac: move PHY attachment error message " Russell King (Oracle)
2025-09-23 11:26 ` [PATCH net-next 4/6] net: stmmac: move initialisation of priv->tx_lpi_timer to stmmac_open() Russell King (Oracle)
2025-09-23 11:26 ` [PATCH net-next 5/6] net: stmmac: move PHY handling out of __stmmac_open()/release() Russell King (Oracle)
2026-04-15 6:08 ` Alexander Stein
2026-04-15 12:59 ` Russell King (Oracle)
2026-04-16 6:20 ` Alexander Stein
2026-04-16 10:49 ` Russell King (Oracle)
2026-04-16 12:02 ` Alexander Stein
2026-04-16 12:13 ` Russell King (Oracle)
2026-04-16 13:47 ` Russell King (Oracle)
2026-04-16 16:08 ` Jakub Kicinski
2026-04-16 19:46 ` Russell King (Oracle)
2026-04-16 20:16 ` Jakub Kicinski
2026-04-17 7:11 ` Maxime Chevallier
2026-04-17 8:47 ` Alexander Stein
2026-04-17 17:30 ` Andrew Lunn
2025-09-23 11:26 ` [PATCH net-next 6/6] net: stmmac: simplify stmmac_init_phy() Russell King (Oracle)
2025-09-23 11:31 ` [PATCH net-next 0/6] net: stmmac: yet more cleanups Russell King (Oracle)
2025-09-23 14:09 ` Maxime Chevallier
2025-09-25 0:50 ` patchwork-bot+netdevbpf
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=E1v119j-0000000773s-1R2v@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.