--- a/drivers/net/wireless/ath/ath11k/nss.c
+++ b/drivers/net/wireless/ath/ath11k/nss.c
@@ -978,36 +978,20 @@ ath11k_nss_vdev_data_receive(struct net_
 			     __attribute__((unused)) struct napi_struct *napi)
 {
 	struct wireless_dev *wdev = NULL;
-	struct ieee80211_vif *vif = NULL;
 	struct ath11k_vif *arvif;
 	struct ath11k_base *ab;
 	bool eth_decap = false;
 	int data_offs = 0;
 	int ret;
 
-	if (!dev) {
-		dev_kfree_skb_any(skb);
-		return;
-	}
-
-	wdev = dev->ieee80211_ptr;
-	if (!wdev) {
-		dev_kfree_skb_any(skb);
-		return;
-	}
-
-	vif = wdev_to_ieee80211_vif(wdev);
-	if (!vif) {
-		dev_kfree_skb_any(skb);
-		return;
-	}
-
-	arvif = (struct ath11k_vif *)vif->drv_priv;
+	arvif = ath11k_nss_get_arvif_from_dev(dev);
 	if (!arvif) {
 		dev_kfree_skb_any(skb);
 		return;
 	}
 
+	wdev = ieee80211_vif_to_wdev_relaxed(arvif->vif);
+
 	ab = arvif->ar->ab;
 
 	skb->dev = dev;
@@ -1016,7 +1000,7 @@ ath11k_nss_vdev_data_receive(struct net_
 	ath11k_dbg_dump(ab, ATH11K_DBG_DP_RX, "", "dp rx msdu from nss: ",
 			skb->data, skb->len);
 
-	if ((vif->type == NL80211_IFTYPE_STATION && wdev->use_4addr) &&
+	if ((arvif->vif->type == NL80211_IFTYPE_STATION && wdev->use_4addr) &&
 	     ath11k_nss_vdev_data_receive_mec_check(arvif->ar, skb)) {
 		dev_kfree_skb_any(skb);
 		return;
