From 55963d748b13d0a8ceef1219e70e02da4dc9e20a Mon Sep 17 00:00:00 2001 From: Franky Lin Date: Mon, 8 Aug 2011 15:58:51 +0200 Subject: [PATCH] staging: brcm80211: remove struct brcmf_sdioh_driver from brcmfmac brcmf_sdioh_driver is a legacy bus driver interface we dont need any more. Reviewed-by: Roland Vossen Signed-off-by: Arend van Spriel Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 11 +++-------- drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 4 ++++ drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 17 +++-------------- drivers/staging/brcm80211/brcmfmac/sdio_host.h | 11 +---------- 4 files changed, 11 insertions(+), 32 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c index 0cd449d332e6..82d9d2cc69c2 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c @@ -50,9 +50,6 @@ struct brcmf_sdio_card { u32 sbwad; /* Save backplane window address */ }; -/* driver info, initialized when brcmf_sdio_register is called */ -static struct brcmf_sdioh_driver drvinfo = { NULL, NULL }; - /* Module parameters specific to each host-controller driver */ module_param(sd_f2_blocksize, int, 0); @@ -443,7 +440,7 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) vendevid = brcmf_sdcard_query_device(sdiodev->card); /* try to attach to the target device */ - sdiodev->bus = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF), + sdiodev->bus = brcmf_sdbrcm_probe((vendevid >> 16), (vendevid & 0xFFFF), 0, 0, 0, 0, regs, sdiodev->card); if (!sdiodev->bus) { BRCMF_ERROR(("%s: device attach failed\n", __func__)); @@ -462,7 +459,7 @@ EXPORT_SYMBOL(brcmf_sdio_probe); int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev) { if (sdiodev->bus) { - drvinfo.detach(sdiodev->bus); + brcmf_sdbrcm_disconnect(sdiodev->bus); sdiodev->bus = NULL; } @@ -477,10 +474,8 @@ int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev) } EXPORT_SYMBOL(brcmf_sdio_remove); -int brcmf_sdio_register(struct brcmf_sdioh_driver *driver) +int brcmf_sdio_register(void) { - drvinfo = *driver; - return brcmf_sdio_function_init(); } diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h index 653cf0daa0eb..0fb32509ceee 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h +++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h @@ -75,4 +75,8 @@ extern void brcmf_bus_clearcounts(struct brcmf_pub *drvr); extern void brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick); +extern void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no, + u16 slot, u16 func, uint bustype, u32 regsva, + void *card); +extern void brcmf_sdbrcm_disconnect(void *ptr); #endif /* _BRCMF_BUS_H_ */ diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index 6c96f7774818..1b847678c47d 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c @@ -962,7 +962,6 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter); static void brcmf_sdbrcm_release(struct brcmf_bus *bus); static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus); -static void brcmf_sdbrcm_disconnect(void *ptr); static bool brcmf_sdbrcm_chipmatch(u16 chipid); static bool brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva, u16 devid); @@ -5431,7 +5430,7 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid) return false; } -static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no, +void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no, u16 slot, u16 func, uint bustype, u32 regsva, void *card) { @@ -5889,7 +5888,7 @@ static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus) BRCMF_TRACE(("%s: Disconnected\n", __func__)); } -static void brcmf_sdbrcm_disconnect(void *ptr) +void brcmf_sdbrcm_disconnect(void *ptr) { struct brcmf_bus *bus = (struct brcmf_bus *)ptr; @@ -5901,16 +5900,6 @@ static void brcmf_sdbrcm_disconnect(void *ptr) BRCMF_TRACE(("%s: Disconnected\n", __func__)); } -/* Register/Unregister functions are called by the main DHD entry - * point (e.g. module insertion) to link with the bus driver, in - * order to look for or await the device. - */ - -static struct brcmf_sdioh_driver brcmf_sdio = { - brcmf_sdbrcm_probe, - brcmf_sdbrcm_disconnect -}; - int brcmf_bus_register(void) { BRCMF_TRACE(("%s: Enter\n", __func__)); @@ -5930,7 +5919,7 @@ int brcmf_bus_register(void) return -EINVAL; } while (0); - return brcmf_sdio_register(&brcmf_sdio); + return brcmf_sdio_register(); } void brcmf_bus_unregister(void) diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h index f4e2329fd6b5..3d6c2613432f 100644 --- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h +++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h @@ -278,20 +278,11 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name, /* helper functions */ -/* callback functions */ -struct brcmf_sdioh_driver { - /* attach to device */ - void *(*attach) (u16 vend_id, u16 dev_id, u16 bus, u16 slot, - u16 func, uint bustype, u32 regsva, void *param); - /* detach from device */ - void (*detach) (void *ch); -}; - struct sdioh_info; /* platform specific/high level functions */ extern int brcmf_sdio_function_init(void); -extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver); +extern int brcmf_sdio_register(void); extern void brcmf_sdio_unregister(void); extern void brcmf_sdio_function_cleanup(void); extern int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev); -- 2.20.1