1 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
2 +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
3 @@ -592,27 +592,6 @@ void ai_detach(struct si_pub *sih)
7 -/* return index of coreid or BADIDX if not found */
8 -struct bcma_device *ai_findcore(struct si_pub *sih, u16 coreid, u16 coreunit)
10 - struct bcma_device *core;
11 - struct si_info *sii;
14 - sii = container_of(sih, struct si_info, pub);
18 - list_for_each_entry(core, &sii->icbus->cores, list)
19 - if (core->id.id == coreid) {
20 - if (found == coreunit)
29 * read/modify chipcommon core register.
31 @@ -688,12 +667,13 @@ ai_clkctl_setdelay(struct si_pub *sih, s
32 /* initialize power control delay registers */
33 void ai_clkctl_init(struct si_pub *sih)
35 + struct si_info *sii = container_of(sih, struct si_info, pub);
36 struct bcma_device *cc;
38 if (!(ai_get_cccaps(sih) & CC_CAP_PWR_CTL))
41 - cc = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0);
42 + cc = sii->icbus->drv_cc.core;;
46 @@ -725,7 +705,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si
50 - cc = ai_findcore(sih, CC_CORE_ID, 0);
51 + cc = sii->icbus->drv_cc.core;;
53 slowminfreq = ai_slowclk_freq(sih, false, cc);
54 fpdelay = (((bcma_read32(cc, CHIPCREGOFFS(pll_on_delay)) + 2)
55 @@ -749,7 +729,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en
57 sii = container_of(sih, struct si_info, pub);
59 - cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0);
60 + cc = sii->icbus->drv_cc.core;;
61 bcma_core_set_clockmode(cc, mode);
62 return mode == BCMA_CLKMODE_FAST;
64 @@ -778,9 +758,10 @@ void ai_pci_down(struct si_pub *sih)
65 /* Enable BT-COEX & Ex-PA for 4313 */
66 void ai_epa_4313war(struct si_pub *sih)
68 + struct si_info *sii =container_of(sih, struct si_info, pub);
69 struct bcma_device *cc;
71 - cc = ai_findcore(sih, CC_CORE_ID, 0);
72 + cc = sii->icbus->drv_cc.core;
75 bcma_set32(cc, CHIPCREGOFFS(gpiocontrol), GPIO_CTRL_EPA_EN_MASK);
76 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
77 +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
78 @@ -182,8 +182,6 @@ struct si_info {
81 /* AMBA Interconnect exported externs */
82 -extern struct bcma_device *ai_findcore(struct si_pub *sih,
83 - u16 coreid, u16 coreunit);
84 extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
86 /* === exported functions === */
87 --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.c
88 +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.c
89 @@ -142,10 +142,11 @@ static void si_pmu_res_masks(struct si_p
90 void si_pmu_spuravoid_pllupdate(struct si_pub *sih, u8 spuravoid)
93 + struct si_info *sii = container_of(sih, struct si_info, pub);
94 struct bcma_device *core;
97 - core = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0);
98 + core = sii->icbus->drv_cc.core;
100 switch (ai_get_chip_id(sih)) {
101 case BCM43224_CHIP_ID:
102 @@ -286,10 +287,11 @@ u32 si_pmu_alp_clock(struct si_pub *sih)
104 void si_pmu_init(struct si_pub *sih)
106 + struct si_info *sii = container_of(sih, struct si_info, pub);
107 struct bcma_device *core;
110 - core = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0);
111 + core = sii->icbus->drv_cc.core;
113 if (ai_get_pmurev(sih) == 1)
114 bcma_mask32(core, CHIPCREGOFFS(pmucontrol),
115 @@ -301,11 +303,12 @@ void si_pmu_init(struct si_pub *sih)
116 /* initialize PMU resources */
117 void si_pmu_res_init(struct si_pub *sih)
119 + struct si_info *sii = container_of(sih, struct si_info, pub);
120 struct bcma_device *core;
121 u32 min_mask = 0, max_mask = 0;
123 /* select to chipc */
124 - core = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0);
125 + core = sii->icbus->drv_cc.core;
127 /* Determine min/max rsrc masks */
128 si_pmu_res_masks(sih, &min_mask, &max_mask);
129 @@ -328,6 +331,7 @@ void si_pmu_res_init(struct si_pub *sih)
131 u32 si_pmu_measure_alpclk(struct si_pub *sih)
133 + struct si_info *sii = container_of(sih, struct si_info, pub);
134 struct bcma_device *core;
137 @@ -335,7 +339,7 @@ u32 si_pmu_measure_alpclk(struct si_pub
140 /* Remember original core before switch to chipc */
141 - core = ai_findcore(sih, BCMA_CORE_CHIPCOMMON, 0);
142 + core = sii->icbus->drv_cc.core;
144 if (bcma_read32(core, CHIPCREGOFFS(pmustatus)) & PST_EXTLPOAVAIL) {