Skip to content

Commit

Permalink
usbnet: make usbnet_get_link() fall back to ethtool_op_get_link()
Browse files Browse the repository at this point in the history
Make usbnet_get_link() fall back to ethtool_op_get_link() instead of
defaulting to 1.  
     
This makes usbnet_get_link return valid results without the need for a
driver specific check_connect or mii ops as long as the driver calls
netif_carrier_{on,off}() as appropriate.  cdc_ether is an example of
such a driver.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Mar 2, 2009
1 parent 2cf48a1 commit 05ffb3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ u32 usbnet_get_link (struct net_device *net)
if (dev->mii.mdio_read)
return mii_link_ok(&dev->mii);

/* Otherwise, say we're up (to avoid breaking scripts) */
return 1;
/* Otherwise, dtrt for drivers calling netif_carrier_{on,off} */
return ethtool_op_get_link(net);
}
EXPORT_SYMBOL_GPL(usbnet_get_link);

Expand Down

0 comments on commit 05ffb3e

Please sign in to comment.