Commit 405f8a0e authored by hayeswang's avatar hayeswang Committed by David S. Miller

r8152: autoresume before setting feature

Resume the device before setting the feature.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de3f0d0e
...@@ -2145,6 +2145,11 @@ static int rtl8152_set_features(struct net_device *dev, ...@@ -2145,6 +2145,11 @@ static int rtl8152_set_features(struct net_device *dev,
{ {
netdev_features_t changed = features ^ dev->features; netdev_features_t changed = features ^ dev->features;
struct r8152 *tp = netdev_priv(dev); 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 (changed & NETIF_F_HW_VLAN_CTAG_RX) {
if (features & NETIF_F_HW_VLAN_CTAG_RX) if (features & NETIF_F_HW_VLAN_CTAG_RX)
...@@ -2153,7 +2158,10 @@ static int rtl8152_set_features(struct net_device *dev, ...@@ -2153,7 +2158,10 @@ static int rtl8152_set_features(struct net_device *dev,
rtl_rx_vlan_en(tp, false); 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) #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment