2012-06-02 00:17:04 +03:00
|
|
|
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
|
|
|
|
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
|
|
|
|
@@ -584,7 +584,7 @@ void ai_detach(struct si_pub *sih)
|
|
|
|
struct si_pub *si_local = NULL;
|
|
|
|
memcpy(&si_local, &sih, sizeof(struct si_pub **));
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
|
|
|
|
if (sii == NULL)
|
|
|
|
return;
|
|
|
|
@@ -599,7 +599,7 @@ struct bcma_device *ai_findcore(struct s
|
|
|
|
struct si_info *sii;
|
|
|
|
uint found;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
|
|
|
|
found = 0;
|
|
|
|
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -622,7 +622,7 @@ uint ai_cc_reg(struct si_pub *sih, uint
|
2012-06-02 00:17:04 +03:00
|
|
|
u32 w;
|
|
|
|
struct si_info *sii;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
cc = sii->icbus->drv_cc.core;
|
|
|
|
|
|
|
|
/* mask and set */
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -715,7 +715,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si
|
2012-06-02 00:17:04 +03:00
|
|
|
uint slowminfreq;
|
|
|
|
u16 fpdelay;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
if (ai_get_cccaps(sih) & CC_CAP_PMU) {
|
|
|
|
fpdelay = si_pmu_fast_pwrup_delay(sih);
|
|
|
|
return fpdelay;
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -747,7 +747,7 @@ bool ai_clkctl_cc(struct si_pub *sih, en
|
2012-06-02 00:17:04 +03:00
|
|
|
struct si_info *sii;
|
|
|
|
struct bcma_device *cc;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
|
|
|
|
cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0);
|
|
|
|
bcma_core_set_clockmode(cc, mode);
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -758,7 +758,7 @@ void ai_pci_up(struct si_pub *sih)
|
2012-06-02 00:17:04 +03:00
|
|
|
{
|
|
|
|
struct si_info *sii;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
|
|
|
|
if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
|
|
|
|
bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true);
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -769,7 +769,7 @@ void ai_pci_down(struct si_pub *sih)
|
2012-06-02 00:17:04 +03:00
|
|
|
{
|
|
|
|
struct si_info *sii;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
|
|
|
|
if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
|
|
|
|
bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, false);
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -792,7 +792,7 @@ bool ai_deviceremoved(struct si_pub *sih
|
2012-06-02 00:17:04 +03:00
|
|
|
u32 w;
|
|
|
|
struct si_info *sii;
|
|
|
|
|
|
|
|
- sii = (struct si_info *)sih;
|
|
|
|
+ sii = container_of(sih, struct si_info, pub);
|
|
|
|
|
|
|
|
if (sii->icbus->hosttype != BCMA_HOSTTYPE_PCI)
|
|
|
|
return false;
|