[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1vGy5P-0000000DhQJ-0Oi3@rmk-PC.armlinux.org.uk>
Date: Thu, 06 Nov 2025 11:23:27 +0000
From: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>,
Vladimir Zapolskiy <vz@...ia.com>
Subject: [PATCH net-next 4/9] net: stmmac: lpc18xx: validate phy_intf_sel
Validate the phy_intf_sel value rather than the PHY interface mode.
This will allow us to transition to the ->set_phy_intf_sel() method.
Note that this will allow GMII as well as MII as the phy_intf_sel
value is the same for both.
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
index 0f6be2a17e65..ec60968113b8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
@@ -47,14 +47,13 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
return PTR_ERR(reg);
}
- if (plat_dat->phy_interface != PHY_INTERFACE_MODE_MII &&
- plat_dat->phy_interface != PHY_INTERFACE_MODE_RMII) {
+ ethmode = stmmac_get_phy_intf_sel(plat_dat->phy_interface);
+ if (ethmode != PHY_INTF_SEL_GMII_MII &&
+ ethmode != PHY_INTF_SEL_RMII) {
dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
return -EINVAL;
}
- ethmode = stmmac_get_phy_intf_sel(plat_dat->phy_interface);
-
regmap_update_bits(reg, LPC18XX_CREG_CREG6,
LPC18XX_CREG_CREG6_ETHMODE_MASK, ethmode);
--
2.47.3
Powered by blists - more mailing lists