Revert "ethtool: check device is present when getting link settings"
This reverts commit ef4f72282f
.
This commit is contained in:
parent
eac4761f23
commit
92b9ce75e1
2 changed files with 1 additions and 4 deletions
|
@ -213,7 +213,7 @@ static ssize_t speed_show(struct device *dev,
|
||||||
if (!rtnl_trylock())
|
if (!rtnl_trylock())
|
||||||
return restart_syscall();
|
return restart_syscall();
|
||||||
|
|
||||||
if (netif_running(netdev)) {
|
if (netif_running(netdev) && netif_device_present(netdev)) {
|
||||||
struct ethtool_link_ksettings cmd;
|
struct ethtool_link_ksettings cmd;
|
||||||
|
|
||||||
if (!__ethtool_get_link_ksettings(netdev, &cmd))
|
if (!__ethtool_get_link_ksettings(netdev, &cmd))
|
||||||
|
|
|
@ -432,9 +432,6 @@ int __ethtool_get_link_ksettings(struct net_device *dev,
|
||||||
if (!dev->ethtool_ops->get_link_ksettings)
|
if (!dev->ethtool_ops->get_link_ksettings)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
if (!netif_device_present(dev))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
memset(link_ksettings, 0, sizeof(*link_ksettings));
|
memset(link_ksettings, 0, sizeof(*link_ksettings));
|
||||||
return dev->ethtool_ops->get_link_ksettings(dev, link_ksettings);
|
return dev->ethtool_ops->get_link_ksettings(dev, link_ksettings);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue