amd-xgbe: Update connection validation for backplane mode
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Thu, 17 Nov 2016 14:43:37 +0000 (08:43 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Nov 2016 17:28:09 +0000 (12:28 -0500)
Update the connection type enumeration for backplane mode and return
an error when there is a mismatch between the mode and the connection
type.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

index 348cc8cf5e74f9b7920e0028b9c70fd7d7f3554a..9d8c953083b4efa0c430c8b3e539625a90f4b1fb 100644 (file)
@@ -164,6 +164,7 @@ enum xgbe_conn_type {
        XGBE_CONN_TYPE_NONE = 0,
        XGBE_CONN_TYPE_SFP,
        XGBE_CONN_TYPE_MDIO,
+       XGBE_CONN_TYPE_RSVD1,
        XGBE_CONN_TYPE_BACKPLANE,
        XGBE_CONN_TYPE_MAX,
 };
@@ -2831,6 +2832,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
        if (xgbe_phy_conn_type_mismatch(pdata)) {
                dev_err(pdata->dev, "phy mode/connection mismatch (%#x/%#x)\n",
                        phy_data->port_mode, phy_data->conn_type);
+               return -EINVAL;
        }
 
        /* Validate the mode requested */