netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 9/9] net: stmmac: rk: remove obsolete .set_*_speed() methods
Date: Thu, 12 Jun 2025 16:41:22 +0100	[thread overview]
Message-ID: <E1uPk3O-004CFx-Ir@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aEr1BhIoC6-UM2XV@shell.armlinux.org.uk>

Now that no SoC implements the .set_*_speed() methods, we can get rid
of these methods and the now unused code in rk_set_clk_tx_rate().
Arrange for the function to return an error when the .set_speed()
method is not implemented.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 .../net/ethernet/stmicro/stmmac/dwmac-rk.c    | 21 +------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 7cdb09037da0..18ae12df4a85 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -37,8 +37,6 @@ struct rk_gmac_ops {
 	void (*set_to_rgmii)(struct rk_priv_data *bsp_priv,
 			     int tx_delay, int rx_delay);
 	void (*set_to_rmii)(struct rk_priv_data *bsp_priv);
-	void (*set_rgmii_speed)(struct rk_priv_data *bsp_priv, int speed);
-	void (*set_rmii_speed)(struct rk_priv_data *bsp_priv, int speed);
 	int (*set_speed)(struct rk_priv_data *bsp_priv,
 			 phy_interface_t interface, int speed);
 	void (*set_clock_selection)(struct rk_priv_data *bsp_priv, bool input,
@@ -1707,29 +1705,12 @@ static int rk_set_clk_tx_rate(void *bsp_priv_, struct clk *clk_tx_i,
 			      phy_interface_t interface, int speed)
 {
 	struct rk_priv_data *bsp_priv = bsp_priv_;
-	struct device *dev = &bsp_priv->pdev->dev;
 
 	if (bsp_priv->ops->set_speed)
 		return bsp_priv->ops->set_speed(bsp_priv, bsp_priv->phy_iface,
 						speed);
 
-	switch (bsp_priv->phy_iface) {
-	case PHY_INTERFACE_MODE_RGMII:
-	case PHY_INTERFACE_MODE_RGMII_ID:
-	case PHY_INTERFACE_MODE_RGMII_RXID:
-	case PHY_INTERFACE_MODE_RGMII_TXID:
-		if (bsp_priv->ops->set_rgmii_speed)
-			bsp_priv->ops->set_rgmii_speed(bsp_priv, speed);
-		break;
-	case PHY_INTERFACE_MODE_RMII:
-		if (bsp_priv->ops->set_rmii_speed)
-			bsp_priv->ops->set_rmii_speed(bsp_priv, speed);
-		break;
-	default:
-		dev_err(dev, "unsupported interface %d", bsp_priv->phy_iface);
-	}
-
-	return 0;
+	return -EINVAL;
 }
 
 static int rk_gmac_probe(struct platform_device *pdev)
-- 
2.30.2


  parent reply	other threads:[~2025-06-12 15:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 15:40 [PATCH net-next 0/9] net: stmmac: rk: much needed cleanups Russell King (Oracle)
2025-06-12 15:40 ` [PATCH net-next 1/9] net: stmmac: rk: add get_interfaces() implementation Russell King (Oracle)
2025-06-12 15:46   ` Andrew Lunn
2025-06-12 15:40 ` [PATCH net-next 2/9] net: stmmac: rk: simplify set_*_speed() Russell King (Oracle)
2025-06-12 15:47   ` Andrew Lunn
2025-06-12 15:40 ` [PATCH net-next 3/9] net: stmmac: rk: add struct for programming register based speeds Russell King (Oracle)
2025-06-12 15:48   ` Andrew Lunn
2025-06-12 15:40 ` [PATCH net-next 4/9] net: stmmac: rk: combine rv1126 set_*_speed() methods Russell King (Oracle)
2025-06-12 15:49   ` Andrew Lunn
2025-06-12 15:41 ` [PATCH net-next 5/9] net: stmmac: rk: combine clk_mac_speed rate setting functions Russell King (Oracle)
2025-06-12 15:49   ` Andrew Lunn
2025-06-12 15:41 ` [PATCH net-next 6/9] net: stmmac: rk: combine .set_*_speed() methods Russell King (Oracle)
2025-06-12 15:51   ` Andrew Lunn
2025-06-12 15:41 ` [PATCH net-next 7/9] net: stmmac: rk: simplify px30_set_rmii_speed() Russell King (Oracle)
2025-06-12 15:52   ` Andrew Lunn
2025-06-12 15:41 ` [PATCH net-next 8/9] net: stmmac: rk: convert px30_set_rmii_speed() to .set_speed() Russell King (Oracle)
2025-06-12 15:52   ` Andrew Lunn
2025-06-12 15:41 ` Russell King (Oracle) [this message]
2025-06-12 15:53   ` [PATCH net-next 9/9] net: stmmac: rk: remove obsolete .set_*_speed() methods Andrew Lunn
2025-06-14  1:30 ` [PATCH net-next 0/9] net: stmmac: rk: much needed cleanups 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=E1uPk3O-004CFx-Ir@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).