[RFC,net-next,04/10] net: stmmac: use ver->userver and ver->snpsver to print version

Message ID E1wAPBb-0000000F7k5-2d0y@rmk-PC.armlinux.org.uk (mailing list archive)
State New
Headers
Series net: stmmac: clean up / fix synopsys IP version checks |

Commit Message

Russell King (Oracle) April 8, 2026, 9:26 a.m. UTC
Rather than using FIELD_GET() twice, reorder the code to extract the
version fields into struct stmmac_version, and then print them.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/hwif.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
index aacf78d4a2ee..7f95a2a5be4c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
@@ -42,12 +42,11 @@  static void stmmac_get_version(struct stmmac_priv *priv,
 		return;
 	}
 
-	dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n",
-		 FIELD_GET(DWMAC_USERVER, version),
-		 FIELD_GET(DWMAC_SNPSVER, version));
-
 	ver->snpsver = FIELD_GET(DWMAC_SNPSVER, version);
 	ver->userver = FIELD_GET(DWMAC_USERVER, version);
+
+	dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n",
+		 ver->userver, ver->snpsver);
 }
 
 static void stmmac_dwmac_mode_quirk(struct stmmac_priv *priv)