net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Thu, 20 May 2021 12:51:16 +0000 (20:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 May 2021 22:49:33 +0000 (15:49 -0700)
This should be a mistake to fix conflicts when removing RFC tag to
repost the patch.

Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index fea3bf0..df4ce59 100644 (file)
@@ -6191,12 +6191,6 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid
        bool is_double = false;
        int ret;
 
-       ret = pm_runtime_get_sync(priv->device);
-       if (ret < 0) {
-               pm_runtime_put_noidle(priv->device);
-               return ret;
-       }
-
        if (be16_to_cpu(proto) == ETH_P_8021AD)
                is_double = true;
 
@@ -6222,6 +6216,12 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi
        bool is_double = false;
        int ret;
 
+       ret = pm_runtime_get_sync(priv->device);
+       if (ret < 0) {
+               pm_runtime_put_noidle(priv->device);
+               return ret;
+       }
+
        if (be16_to_cpu(proto) == ETH_P_8021AD)
                is_double = true;