aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_link.c
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-08-12 04:22:59 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-13 02:02:21 -0400
commit97b41dad385bce97d60b8cdd56342f07f93fc5d2 (patch)
treef5d502735495eca994dc50969617b2abaa13813e /drivers/net/bnx2x_link.c
parentb1607af526fd408b244c7b32a0c256c1ef163a17 (diff)
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: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_link.c')
-rw-r--r--drivers/net/bnx2x_link.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c
index c9252498d51d..aee9fff9619a 100644
--- a/drivers/net/bnx2x_link.c
+++ b/drivers/net/bnx2x_link.c
@@ -5393,7 +5393,7 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
5393 struct bnx2x *bp; 5393 struct bnx2x *bp;
5394 u32 ext_phy_type = 0; 5394 u32 ext_phy_type = 0;
5395 u32 spirom_ver = 0; 5395 u32 spirom_ver = 0;
5396 u8 status = 0 ; 5396 u8 status;
5397 5397
5398 if (version == NULL || params == NULL) 5398 if (version == NULL || params == NULL)
5399 return -EINVAL; 5399 return -EINVAL;
@@ -5403,6 +5403,7 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
5403 offsetof(struct shmem_region, 5403 offsetof(struct shmem_region,
5404 port_mb[params->port].ext_phy_fw_version)); 5404 port_mb[params->port].ext_phy_fw_version));
5405 5405
5406 status = 0;
5406 /* reset the returned value to zero */ 5407 /* reset the returned value to zero */
5407 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); 5408 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config);
5408 switch (ext_phy_type) { 5409 switch (ext_phy_type) {
@@ -5421,7 +5422,6 @@ u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
5421 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072: 5422 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072:
5422 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073: 5423 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073:
5423 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727: 5424 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727:
5424 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705:
5425 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706: 5425 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706:
5426 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726: 5426 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726:
5427 status = bnx2x_format_ver(spirom_ver, version, len); 5427 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,
5432 status = bnx2x_format_ver(spirom_ver, version, len); 5432 status = bnx2x_format_ver(spirom_ver, version, len);
5433 break; 5433 break;
5434 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT: 5434 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
5435 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705:
5436 version[0] = '\0';
5435 break; 5437 break;
5436 5438
5437 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE: 5439 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE: