Skip to content

Commit 7a97856

Browse files
Ming Leidavem330
authored andcommitted
usbnet: ax88179_1781: apply usbnet_link_change
Use usbnet_link_change to handle link change centrally. Signed-off-by: Ming Lei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent eae6591 commit 7a97856

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/net/usb/ax88179_178a.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,7 @@ static void ax88179_status(struct usbnet *dev, struct urb *urb)
352352
link = (((__force u32)event->intdata1) & AX_INT_PPLS_LINK) >> 16;
353353

354354
if (netif_carrier_ok(dev->net) != link) {
355-
if (link)
356-
usbnet_defer_kevent(dev, EVENT_LINK_RESET);
357-
else
358-
netif_carrier_off(dev->net);
359-
355+
usbnet_link_change(dev, link, 1);
360356
netdev_info(dev->net, "ax88179 - Link status is: %d\n", link);
361357
}
362358
}
@@ -455,7 +451,7 @@ static int ax88179_resume(struct usb_interface *intf)
455451
u16 tmp16;
456452
u8 tmp8;
457453

458-
netif_carrier_off(dev->net);
454+
usbnet_link_change(dev, 0, 0);
459455

460456
/* Power up ethernet PHY */
461457
tmp16 = 0;
@@ -1068,7 +1064,7 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
10681064
/* Restart autoneg */
10691065
mii_nway_restart(&dev->mii);
10701066

1071-
netif_carrier_off(dev->net);
1067+
usbnet_link_change(dev, 0, 0);
10721068

10731069
return 0;
10741070
}
@@ -1356,7 +1352,7 @@ static int ax88179_reset(struct usbnet *dev)
13561352
/* Restart autoneg */
13571353
mii_nway_restart(&dev->mii);
13581354

1359-
netif_carrier_off(dev->net);
1355+
usbnet_link_change(dev, 0, 0);
13601356

13611357
return 0;
13621358
}

0 commit comments

Comments
 (0)