usbnet: dm9601: apply usbnet_link_change
authorMing Lei <ming.lei@canonical.com>
Thu, 11 Apr 2013 04:40:37 +0000 (04:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Apr 2013 19:57:17 +0000 (15:57 -0400)
Use usbnet_link_change to handle link change centrally.

Cc: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/dm9601.c

index 174e5ec..2dbb946 100644 (file)
@@ -524,12 +524,7 @@ static void dm9601_status(struct usbnet *dev, struct urb *urb)
 
        link = !!(buf[0] & 0x40);
        if (netif_carrier_ok(dev->net) != link) {
-               if (link) {
-                       netif_carrier_on(dev->net);
-                       usbnet_defer_kevent (dev, EVENT_LINK_RESET);
-               }
-               else
-                       netif_carrier_off(dev->net);
+               usbnet_link_change(dev, link, 1);
                netdev_dbg(dev->net, "Link Status is: %d\n", link);
        }
 }