Re: [PATCH net-next 2/4] net: phy: mxl-gpy: cache PHY firmware version

From: Michael Walle
Date: Tue Jul 12 2022 - 09:28:15 EST


Am 2022-07-12 15:24, schrieb Andrew Lunn:
+ priv->fw_type = FIELD_GET(PHY_FWV_TYPE_MASK, fw_version);
+ priv->fw_minor = FIELD_GET(PHY_FWV_MINOR_MASK, fw_version);

ret = gpy_hwmon_register(phydev);
if (ret)
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");

Maybe use fw_type and fw_minor. It makes the patch a bit bigger, but
makes the code more consistent.

See next patches ;) And fw_{type,minor} doesn't contain the REL_MASK.
I chose not to cached that as it just used during this reporting.

-michael