diff options
| author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-11-06 11:23:21 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-11-07 19:05:48 -0800 |
| commit | 9882f12194082a0178a025946911e677cfdcd8d8 (patch) | |
| tree | d41612a7b6fc449350fc690363c1fdb259c42006 /drivers | |
| parent | eb0533c7e63be03c1220f24bd00aeb2a4f0e3f78 (diff) | |
net: stmmac: lpc18xx: use stmmac_get_phy_intf_sel()
Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the
phy_intf_sel value, and use the result to program the ethernet mode.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vGy5J-0000000DhQD-46Ob@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c index 895d16dc0a4b..0f6be2a17e65 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c @@ -47,15 +47,14 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev) return PTR_ERR(reg); } - if (plat_dat->phy_interface == PHY_INTERFACE_MODE_MII) { - ethmode = PHY_INTF_SEL_GMII_MII; - } else if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) { - ethmode = PHY_INTF_SEL_RMII; - } else { + if (plat_dat->phy_interface != PHY_INTERFACE_MODE_MII && + plat_dat->phy_interface != PHY_INTERFACE_MODE_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); |
