summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2009-03-01 20:45:40 -0800
committerDavid S. Miller <davem@davemloft.net>2009-03-01 20:45:40 -0800
commit05ffb3e287dfa8ad9fdf29089837b54bc6473303 (patch)
tree8206ab8731a7324e869244b4934c08349444ce7e
parent2cf48a10aa1f45c7b1f1117a829f2f8a1a1309e2 (diff)
downloadlinux-05ffb3e287dfa8ad9fdf29089837b54bc6473303.tar.bz2
usbnet: make usbnet_get_link() fall back to ethtool_op_get_link()
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>
-rw-r--r--drivers/net/usb/usbnet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index aa3149078888..c32284ff3f54 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -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);