Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97b41dad authored by Eilon Greenstein's avatar Eilon Greenstein Committed by David S. Miller
Browse files

bnx2x: get_ext_phy_fw_version returns NULL if not applicable



To avoid confusion, if the PHY does not have a FW (and so, no FW version) make
sure that the string is NULL.

Signed-off-by: default avatarYaniv Rosner <yanivr@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b1607af5
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -5393,7 +5393,7 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
	struct bnx2x *bp;
	struct bnx2x *bp;
	u32 ext_phy_type = 0;
	u32 ext_phy_type = 0;
	u32 spirom_ver = 0;
	u32 spirom_ver = 0;
	u8 status = 0 ;
	u8 status;


	if (version == NULL || params == NULL)
	if (version == NULL || params == NULL)
		return -EINVAL;
		return -EINVAL;
@@ -5403,6 +5403,7 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
		   offsetof(struct shmem_region,
		   offsetof(struct shmem_region,
			    port_mb[params->port].ext_phy_fw_version));
			    port_mb[params->port].ext_phy_fw_version));


	status = 0;
	/* reset the returned value to zero */
	/* reset the returned value to zero */
	ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config);
	ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config);
	switch (ext_phy_type) {
	switch (ext_phy_type) {
@@ -5421,7 +5422,6 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726:
		status = bnx2x_format_ver(spirom_ver, version, len);
		status = bnx2x_format_ver(spirom_ver, version, len);
@@ -5432,6 +5432,8 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
		status = bnx2x_format_ver(spirom_ver, version, len);
		status = bnx2x_format_ver(spirom_ver, version, len);
		break;
		break;
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705:
		version[0] = '\0';
		break;
		break;


	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE:
	case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE: