Skip to content

Commit befb2de

Browse files
hayesorzdavem330
authored andcommitted
r8152: move the initialization to reset_resume function
Move tp->rtl_ops.init() from rtl8152_resume() to rtl8152_reset_resume(). The initialization is only necessary for reset_resume(). Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 49d1034 commit befb2de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/net/usb/r8152.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3776,11 +3776,8 @@ static int rtl8152_resume(struct usb_interface *intf)
37763776

37773777
mutex_lock(&tp->control);
37783778

3779-
if (!test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
3780-
tp->rtl_ops.init(tp);
3781-
queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
3779+
if (!test_bit(SELECTIVE_SUSPEND, &tp->flags))
37823780
netif_device_attach(netdev);
3783-
}
37843781

37853782
if (netif_running(netdev) && netdev->flags & IFF_UP) {
37863783
if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
@@ -3826,6 +3823,10 @@ static int rtl8152_reset_resume(struct usb_interface *intf)
38263823
struct r8152 *tp = usb_get_intfdata(intf);
38273824

38283825
clear_bit(SELECTIVE_SUSPEND, &tp->flags);
3826+
mutex_lock(&tp->control);
3827+
tp->rtl_ops.init(tp);
3828+
queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
3829+
mutex_unlock(&tp->control);
38293830
return rtl8152_resume(intf);
38303831
}
38313832

0 commit comments

Comments
 (0)