net: stmmac: lpc18xx: use PHY_INTF_SEL_x directly

Use the PHY_INTF_SEL_x values directly rather than the driver private
LPC18XX_CREG_CREG6_ETHMODE_x definitions, and convert
LPC18XX_CREG_CREG6_ETHMODE_MASK to use GENMASK().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vGy5E-0000000DhQ7-3cuy@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Russell King (Oracle)
2025-11-06 11:23:16 +00:00
committed by Jakub Kicinski
parent 5636fcdb02
commit eb0533c7e6

View File

@@ -21,9 +21,7 @@
/* Register defines for CREG syscon */
#define LPC18XX_CREG_CREG6 0x12c
# define LPC18XX_CREG_CREG6_ETHMODE_MASK 0x7
# define LPC18XX_CREG_CREG6_ETHMODE_MII PHY_INTF_SEL_GMII_MII
# define LPC18XX_CREG_CREG6_ETHMODE_RMII PHY_INTF_SEL_RMII
# define LPC18XX_CREG_CREG6_ETHMODE_MASK GENMASK(2, 0)
static int lpc18xx_dwmac_probe(struct platform_device *pdev)
{
@@ -50,9 +48,9 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
}
if (plat_dat->phy_interface == PHY_INTERFACE_MODE_MII) {
ethmode = LPC18XX_CREG_CREG6_ETHMODE_MII;
ethmode = PHY_INTF_SEL_GMII_MII;
} else if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) {
ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII;
ethmode = PHY_INTF_SEL_RMII;
} else {
dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
return -EINVAL;