mac80211: update to wireless-testing 2012-06-14
[openwrt/openwrt.git] / package / mac80211 / patches / 843-brcmsmac-use-container_of-instead-of-cast.patch
1 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
2 +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
3 @@ -584,7 +584,7 @@ void ai_detach(struct si_pub *sih)
4 struct si_pub *si_local = NULL;
5 memcpy(&si_local, &sih, sizeof(struct si_pub **));
6
7 - sii = (struct si_info *)sih;
8 + sii = container_of(sih, struct si_info, pub);
9
10 if (sii == NULL)
11 return;
12 @@ -599,7 +599,7 @@ struct bcma_device *ai_findcore(struct s
13 struct si_info *sii;
14 uint found;
15
16 - sii = (struct si_info *)sih;
17 + sii = container_of(sih, struct si_info, pub);
18
19 found = 0;
20
21 @@ -622,7 +622,7 @@ uint ai_cc_reg(struct si_pub *sih, uint
22 u32 w;
23 struct si_info *sii;
24
25 - sii = (struct si_info *)sih;
26 + sii = container_of(sih, struct si_info, pub);
27 cc = sii->icbus->drv_cc.core;
28
29 /* mask and set */
30 @@ -715,7 +715,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si
31 uint slowminfreq;
32 u16 fpdelay;
33
34 - sii = (struct si_info *)sih;
35 + sii = container_of(sih, struct si_info, pub);
36 if (ai_get_cccaps(sih) & CC_CAP_PMU) {
37 fpdelay = si_pmu_fast_pwrup_delay(sih);
38 return fpdelay;
39 @@ -747,7 +747,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en
40 struct si_info *sii;
41 struct bcma_device *cc;
42
43 - sii = (struct si_info *)sih;
44 + sii = container_of(sih, struct si_info, pub);
45
46 cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0);
47 bcma_core_set_clockmode(cc, mode);
48 @@ -758,7 +758,7 @@ void ai_pci_up(struct si_pub *sih)
49 {
50 struct si_info *sii;
51
52 - sii = (struct si_info *)sih;
53 + sii = container_of(sih, struct si_info, pub);
54
55 if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
56 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true);
57 @@ -769,7 +769,7 @@ void ai_pci_down(struct si_pub *sih)
58 {
59 struct si_info *sii;
60
61 - sii = (struct si_info *)sih;
62 + sii = container_of(sih, struct si_info, pub);
63
64 if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
65 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, false);
66 @@ -792,7 +792,7 @@ bool ai_deviceremoved(struct si_pub *sih
67 u32 w;
68 struct si_info *sii;
69
70 - sii = (struct si_info *)sih;
71 + sii = container_of(sih, struct si_info, pub);
72
73 if (sii->icbus->hosttype != BCMA_HOSTTYPE_PCI)
74 return false;