Skip to content

Commit

Permalink
r8152: move the initialization to reset_resume function
Browse files Browse the repository at this point in the history
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 <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
hayeswang authored and David S. Miller committed Jun 9, 2017
1 parent 49d1034 commit befb2de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -3776,11 +3776,8 @@ static int rtl8152_resume(struct usb_interface *intf)

mutex_lock(&tp->control);

if (!test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
tp->rtl_ops.init(tp);
queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
if (!test_bit(SELECTIVE_SUSPEND, &tp->flags))
netif_device_attach(netdev);
}

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

clear_bit(SELECTIVE_SUSPEND, &tp->flags);
mutex_lock(&tp->control);
tp->rtl_ops.init(tp);
queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
mutex_unlock(&tp->control);
return rtl8152_resume(intf);
}

Expand Down

0 comments on commit befb2de

Please sign in to comment.