Commit 47b4c640 authored by Franky Lin's avatar Franky Lin Committed by Greg Kroah-Hartman

staging: brcm80211: remove global var gInstance from brcmfmac

Use sdio function pointer stored in struct brcmf_sdio_dev instead
of those in gInstance.
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b73b2f9e
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/mmc/card.h>
#include <defs.h> #include <defs.h>
#include <brcm_hw_ids.h> #include <brcm_hw_ids.h>
...@@ -55,12 +56,12 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name, ...@@ -55,12 +56,12 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name,
int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev) int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)
{ {
return brcmf_sdioh_interrupt_register(); return brcmf_sdioh_interrupt_register(sdiodev);
} }
int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev) int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev)
{ {
return brcmf_sdioh_interrupt_deregister(); return brcmf_sdioh_interrupt_deregister(sdiodev);
} }
u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr, u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mmc/sdio.h> #include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include <linux/semaphore.h> #include <linux/semaphore.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -5685,7 +5686,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus) ...@@ -5685,7 +5686,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus)
bus->idleclock = BRCMF_IDLE_ACTIVE; bus->idleclock = BRCMF_IDLE_ACTIVE;
/* Query the F2 block size, set roundup accordingly */ /* Query the F2 block size, set roundup accordingly */
bus->blocksize = bus->sdiodev->func2->cur_blksize; bus->blocksize = bus->sdiodev->func[2]->cur_blksize;
bus->roundup = min(max_roundup, bus->blocksize); bus->roundup = min(max_roundup, bus->blocksize);
/* Query if bus module supports packet chaining, /* Query if bus module supports packet chaining,
...@@ -5828,7 +5829,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus) ...@@ -5828,7 +5829,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)
bus->fw_name = BCM4329_FW_NAME; bus->fw_name = BCM4329_FW_NAME;
ret = request_firmware(&bus->firmware, bus->fw_name, ret = request_firmware(&bus->firmware, bus->fw_name,
&gInstance->func[2]->dev); &bus->sdiodev->func[2]->dev);
if (ret) { if (ret) {
BRCMF_ERROR(("%s: Fail to request firmware %d\n", BRCMF_ERROR(("%s: Fail to request firmware %d\n",
__func__, ret)); __func__, ret));
...@@ -5930,7 +5931,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus) ...@@ -5930,7 +5931,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)
bus->nv_name = BCM4329_NV_NAME; bus->nv_name = BCM4329_NV_NAME;
ret = request_firmware(&bus->firmware, bus->nv_name, ret = request_firmware(&bus->firmware, bus->nv_name,
&gInstance->func[2]->dev); &bus->sdiodev->func[2]->dev);
if (ret) { if (ret) {
BRCMF_ERROR(("%s: Fail to request nvram %d\n", __func__, ret)); BRCMF_ERROR(("%s: Fail to request nvram %d\n", __func__, ret));
return ret; return ret;
......
...@@ -122,20 +122,14 @@ struct brcmf_sdreg { ...@@ -122,20 +122,14 @@ struct brcmf_sdreg {
int value; int value;
}; };
struct brcmf_sdmmc_instance {
struct sdio_func *func[SDIOD_MAX_IOFUNCS];
u32 host_claimed;
atomic_t suspend; /* suspend flag */
};
struct brcmf_sdio_dev { struct brcmf_sdio_dev {
struct sdio_func *func1; struct sdio_func *func[SDIO_MAX_FUNCS];
struct sdio_func *func2;
u8 num_funcs; /* Supported funcs on client */ u8 num_funcs; /* Supported funcs on client */
u32 func_cis_ptr[SDIOD_MAX_IOFUNCS]; u32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
u32 sbwad; /* Save backplane window address */ u32 sbwad; /* Save backplane window address */
bool regfail; /* status of last reg_r/w call */ bool regfail; /* status of last reg_r/w call */
void *bus; void *bus;
atomic_t suspend; /* suspend flag */
}; };
/* Register/deregister device interrupt handler. */ /* Register/deregister device interrupt handler. */
...@@ -253,10 +247,8 @@ extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_dev *sdiodev); ...@@ -253,10 +247,8 @@ extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_dev *sdiodev);
extern int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev); extern int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
extern void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev); extern void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
extern int extern int brcmf_sdioh_interrupt_register(struct brcmf_sdio_dev *sdiodev);
brcmf_sdioh_interrupt_register(void); extern int brcmf_sdioh_interrupt_deregister(struct brcmf_sdio_dev *sdiodev);
extern int brcmf_sdioh_interrupt_deregister(void);
/* read or write one byte using cmd52 */ /* read or write one byte using cmd52 */
extern int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, extern int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw,
...@@ -298,8 +290,6 @@ extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, ...@@ -298,8 +290,6 @@ extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev,
extern uint sd_f2_blocksize; extern uint sd_f2_blocksize;
extern struct brcmf_sdmmc_instance *gInstance;
extern void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype, extern void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
u32 regsva, struct brcmf_sdio_dev *sdiodev); u32 regsva, struct brcmf_sdio_dev *sdiodev);
extern void brcmf_sdbrcm_disconnect(void *ptr); extern void brcmf_sdbrcm_disconnect(void *ptr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment