Thread (26 messages) 26 messages, 5 authors, 2025-11-11

Re: [PATCH net-next 16/16] net: stmmac: visconti: use stmmac_get_phy_intf_sel()

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: 2025-11-09 16:39:17
Also in: linux-amlogic, linux-mediatek, linux-mips, netdev


On 08/11/2025 08:58, Russell King (Oracle) wrote:
On Fri, Nov 07, 2025 at 07:23:26PM +0100, Maxime Chevallier wrote:
quoted
Hi Russell,

On 07/11/2025 15:29, Russell King (Oracle) wrote:
quoted
-	switch (plat_dat->phy_interface) {
-	case PHY_INTERFACE_MODE_RGMII:
-	case PHY_INTERFACE_MODE_RGMII_ID:
-	case PHY_INTERFACE_MODE_RGMII_RXID:
-	case PHY_INTERFACE_MODE_RGMII_TXID:
-		phy_intf_sel = ETHER_CONFIG_INTF_RGMII;
-		break;
-	case PHY_INTERFACE_MODE_MII:
-		phy_intf_sel = ETHER_CONFIG_INTF_MII;
-		break;
-	case PHY_INTERFACE_MODE_RMII:
-		phy_intf_sel = ETHER_CONFIG_INTF_RMII;
-		break;
-	default:
+	int phy_intf_sel;
+
+	phy_intf_sel = stmmac_get_phy_intf_sel(plat_dat->phy_interface);
+	if (phy_intf_sel != PHY_INTF_SEL_GMII_MII &&
+	    phy_intf_sel != PHY_INTF_SEL_RGMII &&
+	    phy_intf_sel != PHY_INTF_SEL_RMII) {
 		dev_err(&pdev->dev, "Unsupported phy-mode (%d)\n", plat_dat->phy_interface);
 		return -EOPNOTSUPP;
 	}
Probably not too big of a deal, but don't we now incorrectly accept the
"gmii" mode ?
We will accept GMII mode, but (a) does that matter, and (b) shouldn't
the DT binding be checking the phy-mode (we have some bindings that do.)
Thanks for the clarification, that's fine by me then :)

Maxime

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help