net: xpcs: clean up xpcs_config_eee()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 10 Feb 2025 10:54:10 +0000 (10:54 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 14 Feb 2025 21:42:52 +0000 (13:42 -0800)
There is now no need to pass the mult_fact into xpcs_config_eee(), so
let's remove that argument and use xpcs->eee_mult_fact directly. While
changing the function signature, as we pass true/false for enable, use
"bool" instead of "int" for this.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1thRQY-003w7U-IG@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/pcs/pcs-xpcs.c

index 6a28a4eae21cf0bfbf74529a9af7b42cf9bdb7ca..cae6e837719138b03bcc7a05f32ec994980971d0 100644 (file)
@@ -602,8 +602,7 @@ static void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces)
                __set_bit(compat->interface, interfaces);
 }
 
-static int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
-                          int enable)
+static int xpcs_config_eee(struct dw_xpcs *xpcs, bool enable)
 {
        u16 mask, val;
        int ret;
@@ -618,7 +617,7 @@ static int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
                      DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN |
                      DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL |
                      FIELD_PREP(DW_VR_MII_EEE_MULT_FACT_100NS,
-                                mult_fact_100ns);
+                                xpcs->eee_mult_fact);
        else
                val = 0;
 
@@ -1197,14 +1196,14 @@ static void xpcs_disable_eee(struct phylink_pcs *pcs)
 {
        struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
 
-       xpcs_config_eee(xpcs, 0, false);
+       xpcs_config_eee(xpcs, false);
 }
 
 static void xpcs_enable_eee(struct phylink_pcs *pcs)
 {
        struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
 
-       xpcs_config_eee(xpcs, xpcs->eee_mult_fact, true);
+       xpcs_config_eee(xpcs, true);
 }
 
 /**