Skip to content

Commit

Permalink
r8152: autoresume before setting feature
Browse files Browse the repository at this point in the history
Resume the device before setting the feature.

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 Oct 9, 2014
1 parent de3f0d0 commit 405f8a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,11 @@ static int rtl8152_set_features(struct net_device *dev,
{
netdev_features_t changed = features ^ dev->features;
struct r8152 *tp = netdev_priv(dev);
int ret;

ret = usb_autopm_get_interface(tp->intf);
if (ret < 0)
goto out;

if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
if (features & NETIF_F_HW_VLAN_CTAG_RX)
Expand All @@ -2153,7 +2158,10 @@ static int rtl8152_set_features(struct net_device *dev,
rtl_rx_vlan_en(tp, false);
}

return 0;
usb_autopm_put_interface(tp->intf);

out:
return ret;
}

#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
Expand Down

0 comments on commit 405f8a0

Please sign in to comment.