]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
usbnet: cdc_ncm: apply usbnet_link_change
authorMing Lei <ming.lei@canonical.com>
Thu, 11 Apr 2013 04:40:33 +0000 (04:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Apr 2013 19:57:16 +0000 (15:57 -0400)
Use the introduced usbnet_link_change to handle link change.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_ncm.c

index 67012cbd55827fd4fd134ceb40b8497fdceca24a..43afde8f48d23e2cc3ee15e4cc55bd298b45dfe4 100644 (file)
@@ -610,7 +610,7 @@ static int cdc_ncm_bind(struct usbnet *dev, struct usb_interface *intf)
         * (carrier is OFF) during attach, so the IP network stack does not
         * start IPv6 negotiation and more.
         */
-       netif_carrier_off(dev->net);
+       usbnet_link_change(dev, 0, 0);
        return ret;
 }
 
@@ -1106,12 +1106,9 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
                        " %sconnected\n",
                        ctx->netdev->name, ctx->connected ? "" : "dis");
 
-               if (ctx->connected)
-                       netif_carrier_on(dev->net);
-               else {
-                       netif_carrier_off(dev->net);
+               usbnet_link_change(dev, ctx->connected, 0);
+               if (!ctx->connected)
                        ctx->tx_speed = ctx->rx_speed = 0;
-               }
                break;
 
        case USB_CDC_NOTIFY_SPEED_CHANGE: