Skip to content

Commit 812a302

Browse files
Karthikeyan PeriyasamyJeff Johnson
authored andcommitted
wifi: ath12k: Refactor the ath12k_hw get helper function argument
Currently, ath12k_hw is placed inside the ath12k_hw_group. However, the ath12k_hw get helper function takes the device handle and the index as parameters. Here, the index parameter is specific to the group handle. Therefore, change this helper function argument from the device handle to the group handle. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy <[email protected]> Acked-by: Jeff Johnson <[email protected]> Acked-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jeff Johnson <[email protected]>
1 parent 21261e4 commit 812a302

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

drivers/net/wireless/ath/ath12k/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ static void ath12k_rfkill_work(struct work_struct *work)
11841184
spin_unlock_bh(&ab->base_lock);
11851185

11861186
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
1187-
ah = ath12k_ab_to_ah(ab, i);
1187+
ah = ath12k_ag_to_ah(ab->ag, i);
11881188
if (!ah)
11891189
continue;
11901190

@@ -1236,7 +1236,7 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
12361236
set_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags);
12371237

12381238
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
1239-
ah = ath12k_ab_to_ah(ab, i);
1239+
ah = ath12k_ag_to_ah(ab->ag, i);
12401240
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
12411241
continue;
12421242

@@ -1275,7 +1275,7 @@ static void ath12k_core_post_reconfigure_recovery(struct ath12k_base *ab)
12751275
int i, j;
12761276

12771277
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
1278-
ah = ath12k_ab_to_ah(ab, i);
1278+
ah = ath12k_ag_to_ah(ab->ag, i);
12791279
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
12801280
continue;
12811281

@@ -1337,7 +1337,7 @@ static void ath12k_core_restart(struct work_struct *work)
13371337
}
13381338

13391339
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
1340-
ah = ath12k_ab_to_ah(ab, i);
1340+
ah = ath12k_ag_to_ah(ab->ag, i);
13411341
ieee80211_restart_hw(ah->hw);
13421342
}
13431343
}

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,9 @@ static inline struct ieee80211_hw *ath12k_ar_to_hw(struct ath12k *ar)
11941194
for ((index) = 0; ((index) < (ah)->num_radio && \
11951195
((ar) = &(ah)->radio[(index)])); (index)++)
11961196

1197-
static inline struct ath12k_hw *ath12k_ab_to_ah(struct ath12k_base *ab, int idx)
1197+
static inline struct ath12k_hw *ath12k_ag_to_ah(struct ath12k_hw_group *ag, int idx)
11981198
{
1199-
return ab->ag->ah[idx];
1199+
return ag->ah[idx];
12001200
}
12011201

12021202
static inline void ath12k_ag_set_ah(struct ath12k_hw_group *ag, int idx,

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11244,7 +11244,7 @@ int ath12k_mac_register(struct ath12k_hw_group *ag)
1124411244
int ret;
1124511245

1124611246
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
11247-
ah = ath12k_ab_to_ah(ab, i);
11247+
ah = ath12k_ag_to_ah(ag, i);
1124811248

1124911249
ret = ath12k_mac_hw_register(ah);
1125011250
if (ret)
@@ -11257,7 +11257,7 @@ int ath12k_mac_register(struct ath12k_hw_group *ag)
1125711257

1125811258
err:
1125911259
for (i = i - 1; i >= 0; i--) {
11260-
ah = ath12k_ab_to_ah(ab, i);
11260+
ah = ath12k_ag_to_ah(ag, i);
1126111261
if (!ah)
1126211262
continue;
1126311263

@@ -11276,7 +11276,7 @@ void ath12k_mac_unregister(struct ath12k_hw_group *ag)
1127611276
clear_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
1127711277

1127811278
for (i = ath12k_get_num_hw(ab) - 1; i >= 0; i--) {
11279-
ah = ath12k_ab_to_ah(ab, i);
11279+
ah = ath12k_ag_to_ah(ag, i);
1128011280
if (!ah)
1128111281
continue;
1128211282

@@ -11357,7 +11357,7 @@ void ath12k_mac_destroy(struct ath12k_hw_group *ag)
1135711357
}
1135811358

1135911359
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
11360-
ah = ath12k_ab_to_ah(ab, i);
11360+
ah = ath12k_ag_to_ah(ag, i);
1136111361
if (!ah)
1136211362
continue;
1136311363

@@ -11438,7 +11438,7 @@ int ath12k_mac_allocate(struct ath12k_hw_group *ag)
1143811438

1143911439
err:
1144011440
for (i = i - 1; i >= 0; i--) {
11441-
ah = ath12k_ab_to_ah(ab, i);
11441+
ah = ath12k_ag_to_ah(ag, i);
1144211442
if (!ah)
1144311443
continue;
1144411444

0 commit comments

Comments
 (0)