br: remove redundant check and init
Since these checks and initialization are done in dev_ethtool_get_settings called later on, remove this redundancy. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e8aaebc6b2
commit
fa3df928e0
|
@ -33,20 +33,18 @@
|
||||||
*/
|
*/
|
||||||
static int port_cost(struct net_device *dev)
|
static int port_cost(struct net_device *dev)
|
||||||
{
|
{
|
||||||
if (dev->ethtool_ops && dev->ethtool_ops->get_settings) {
|
struct ethtool_cmd ecmd;
|
||||||
struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET, };
|
|
||||||
|
|
||||||
if (!dev_ethtool_get_settings(dev, &ecmd)) {
|
if (!dev_ethtool_get_settings(dev, &ecmd)) {
|
||||||
switch (ethtool_cmd_speed(&ecmd)) {
|
switch (ethtool_cmd_speed(&ecmd)) {
|
||||||
case SPEED_10000:
|
case SPEED_10000:
|
||||||
return 2;
|
return 2;
|
||||||
case SPEED_1000:
|
case SPEED_1000:
|
||||||
return 4;
|
return 4;
|
||||||
case SPEED_100:
|
case SPEED_100:
|
||||||
return 19;
|
return 19;
|
||||||
case SPEED_10:
|
case SPEED_10:
|
||||||
return 100;
|
return 100;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue