Commit 8a34b0ae8778f6b42ed38857486b769a224e2536
Committed by
David S. Miller
1 parent
4be74c130d
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
usbnet: cdc_ncm: apply usbnet_link_change
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>
Showing 1 changed file with 3 additions and 6 deletions Side-by-side Diff
drivers/net/usb/cdc_ncm.c
... | ... | @@ -610,7 +610,7 @@ |
610 | 610 | * (carrier is OFF) during attach, so the IP network stack does not |
611 | 611 | * start IPv6 negotiation and more. |
612 | 612 | */ |
613 | - netif_carrier_off(dev->net); | |
613 | + usbnet_link_change(dev, 0, 0); | |
614 | 614 | return ret; |
615 | 615 | } |
616 | 616 | |
617 | 617 | |
... | ... | @@ -1106,12 +1106,9 @@ |
1106 | 1106 | " %sconnected\n", |
1107 | 1107 | ctx->netdev->name, ctx->connected ? "" : "dis"); |
1108 | 1108 | |
1109 | - if (ctx->connected) | |
1110 | - netif_carrier_on(dev->net); | |
1111 | - else { | |
1112 | - netif_carrier_off(dev->net); | |
1109 | + usbnet_link_change(dev, ctx->connected, 0); | |
1110 | + if (!ctx->connected) | |
1113 | 1111 | ctx->tx_speed = ctx->rx_speed = 0; |
1114 | - } | |
1115 | 1112 | break; |
1116 | 1113 | |
1117 | 1114 | case USB_CDC_NOTIFY_SPEED_CHANGE: |