diff mbox series

[net-next,4/4] net: phy: mxl-gpy: print firmware in human readable form

Message ID 20220712131554.2737792-5-michael@walle.cc (mailing list archive)
State Accepted
Commit d523f2eb1dadb74d365365eb3bd921ad8b6b2abb
Delegated to: Netdev Maintainers
Headers show
Series net: phy: mxl-gpy: version fix and improvements | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Michael Walle July 12, 2022, 1:15 p.m. UTC
Now having a major and a minor number, also print the firmware in
human readable form "major.minor". Still keep the 4-digit hexadecimal
representation because that form is used in the firmware changelog
documents. Also, drop the "release" string assuming that most common
case, but make it clearer that the user is running a test version.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 drivers/net/phy/mxl-gpy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Andrew Lunn July 12, 2022, 1:27 p.m. UTC | #1
On Tue, Jul 12, 2022 at 03:15:54PM +0200, Michael Walle wrote:
> Now having a major and a minor number, also print the firmware in
> human readable form "major.minor". Still keep the 4-digit hexadecimal
> representation because that form is used in the firmware changelog
> documents. Also, drop the "release" string assuming that most common
> case, but make it clearer that the user is running a test version.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>

O.K, this answers my earlier question :-)

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index ac62b01c61ed..24bae27eedef 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -230,8 +230,9 @@  static int gpy_probe(struct phy_device *phydev)
 		return ret;
 
 	/* Show GPY PHY FW version in dmesg */
-	phydev_info(phydev, "Firmware Version: 0x%04X (%s)\n", fw_version,
-		    (fw_version & PHY_FWV_REL_MASK) ? "release" : "test");
+	phydev_info(phydev, "Firmware Version: %d.%d (0x%04X%s)\n",
+		    priv->fw_major, priv->fw_minor, fw_version,
+		    fw_version & PHY_FWV_REL_MASK ? "" : " test version");
 
 	return 0;
 }