]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: lpc18xx: use PHY_INTF_SEL_x directly
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 6 Nov 2025 11:23:16 +0000 (11:23 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Nov 2025 03:05:48 +0000 (19:05 -0800)
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>
drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c

index 66c309a7afb3732509cd9aac952895fb8a3be300..895d16dc0a4b52cd4215a1531e612f79c6fe6d7b 100644 (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;