]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mlxsw: spectrum: Report port type according to operational speed
authorIdo Schimmel <idosch@mellanox.com>
Mon, 12 Sep 2016 11:26:25 +0000 (13:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Sep 2016 16:16:33 +0000 (12:16 -0400)
In case port isn't operational we shouldn't report the port type, but
instead return PORT_OTHER. This is consistent with most other drivers
that return PORT_OTHER when media type can't be determined.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index 07930cc1fa60c519035340a4992b6c965e90cd1b..38e4f03f9d9f72d545c0b45d2e5577438812e6f3 100644 (file)
@@ -1828,7 +1828,6 @@ static int mlxsw_sp_port_get_settings(struct net_device *dev,
        mlxsw_sp_from_ptys_speed_duplex(netif_carrier_ok(dev),
                                        eth_proto_oper, cmd);
 
-       eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
        cmd->port = mlxsw_sp_port_connector_port(eth_proto_oper);
 
        if (autoneg_status == MLXSW_REG_PTYS_AN_STATUS_OK && eth_proto_lp)