[PATCH v5 phy-next 03/16] phy: lynx-28g: move lane mode helpers to new core module

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Jun 10 08:44:38 PDT 2026


Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The enum constants for `lynx_lane_mode` lack a subsystem or driver prefix, polluting the global namespace.
- [Low] The newly exported function `phy_interface_to_lane_mode` lacks a driver-specific prefix.
--

commit fb931a9e09ebe42d6f769c59cd1a8698e01312c9
Author: Vladimir Oltean <vladimir.oltean at nxp.com>

phy: lynx-28g: move lane mode helpers to new core module

This commit introduces a new core module for the Lynx SerDes PHY to share
code between the 28G and upcoming 10G drivers. It moves the lane mode
definitions to a public header and exports helper functions.

> diff --git a/drivers/phy/freescale/phy-fsl-lynx-core.c b/drivers/phy/freescale/phy-fsl-lynx-core.c
> new file mode 100644
> index 0000000000000..d56f189c162dc
> --- /dev/null
> +++ b/drivers/phy/freescale/phy-fsl-lynx-core.c
[ ... ]
> +enum lynx_lane_mode phy_interface_to_lane_mode(phy_interface_t intf)
> +{
> +	switch (intf) {

[Severity: Low]
Does this function name need a driver-specific prefix now that it is exported?

Previously, phy_interface_to_lane_mode() was a static function, but since it
is now exported with a generic name, could this cause linker collisions if
another driver implements a function with the same name?

> +	case PHY_INTERFACE_MODE_SGMII:
> +	case PHY_INTERFACE_MODE_1000BASEX:
> +		return LANE_MODE_1000BASEX_SGMII;
[ ... ]

> diff --git a/include/soc/fsl/phy-fsl-lynx.h b/include/soc/fsl/phy-fsl-lynx.h
> new file mode 100644
> index 0000000000000..92e8272d5ae15
> --- /dev/null
> +++ b/include/soc/fsl/phy-fsl-lynx.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/* Copyright 2023-2026 NXP */
> +
> +#ifndef __PHY_FSL_LYNX_H_
> +#define __PHY_FSL_LYNX_H_
> +
> +enum lynx_lane_mode {
> +	LANE_MODE_UNKNOWN,
> +	LANE_MODE_1000BASEX_SGMII,

[Severity: Low]
Would it be safer to add a prefix to these enum constants (like LYNX_ or
FSL_LYNX_) since they are now exposed in a global header? 

Generic names like LANE_MODE_UNKNOWN and LANE_MODE_MAX might conflict with
other definitions in the global namespace.

> +	LANE_MODE_10GBASER,
> +	LANE_MODE_USXGMII,
> +	LANE_MODE_25GBASER,
> +	LANE_MODE_MAX,
> +};
> +
> +#endif /* __PHY_FSL_LYNX_H_ */

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260610151952.2141019-1-vladimir.oltean@nxp.com?part=3



More information about the linux-phy mailing list