staging: brcm80211: removed struct osl_info usage from fullmac driver
authorArend van Spriel <arend@broadcom.com>
Wed, 2 Mar 2011 20:18:42 +0000 (21:18 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 Mar 2011 00:48:03 +0000 (19:48 -0500)
Several occurrences in fullmac using struct osl_info could be removed.

Reviewed-by: Brett Rudley <brudley@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
drivers/staging/brcm80211/brcmfmac/bcmsdh.c
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
drivers/staging/brcm80211/brcmfmac/dhd_bus.h
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/include/bcmsdh.h

index b020a301341f2f3774aa60600499d319a325e111..99e075b484fb9c46cac2580c172e21cde7872f60 100644 (file)
@@ -47,7 +47,7 @@ typedef void (*sdioh_cb_fn_t) (void *);
  *  cfghdl points to the starting address of pci device mapped memory
  */
 extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *cfghdl, uint irq);
-extern SDIOH_API_RC sdioh_detach(struct osl_info *osh, sdioh_info_t *si);
+extern SDIOH_API_RC sdioh_detach(sdioh_info_t *si);
 extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si,
                                             sdioh_cb_fn_t fn, void *argh);
 extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si);
index 77e65e4297a19c7a80b48839e0a9c3b053fb4241..22c8f8dc55ef4fc634121d76a0a26cd637155c5e 100644 (file)
@@ -71,7 +71,7 @@ bcmsdh_info_t *bcmsdh_attach(struct osl_info *osh, void *cfghdl,
 
        bcmsdh->sdioh = sdioh_attach(osh, cfghdl, irq);
        if (!bcmsdh->sdioh) {
-               bcmsdh_detach(osh, bcmsdh);
+               bcmsdh_detach(bcmsdh);
                return NULL;
        }
 
@@ -85,13 +85,13 @@ bcmsdh_info_t *bcmsdh_attach(struct osl_info *osh, void *cfghdl,
        return bcmsdh;
 }
 
-int bcmsdh_detach(struct osl_info *osh, void *sdh)
+int bcmsdh_detach(void *sdh)
 {
        bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
 
        if (bcmsdh != NULL) {
                if (bcmsdh->sdioh) {
-                       sdioh_detach(osh, bcmsdh->sdioh);
+                       sdioh_detach(bcmsdh->sdioh);
                        bcmsdh->sdioh = NULL;
                }
                kfree(bcmsdh);
index deb5f46542aed815757cf9f039cb615312de64f0..1d2d79080eb3496ac42a9dfdf21440e891cbf0f3 100644 (file)
@@ -232,7 +232,7 @@ int bcmsdh_probe(struct device *dev)
 err:
        if (sdhc) {
                if (sdhc->sdh)
-                       bcmsdh_detach(sdhc->osh, sdhc->sdh);
+                       bcmsdh_detach(sdhc->sdh);
                kfree(sdhc);
        }
        if (osh)
@@ -250,7 +250,7 @@ int bcmsdh_remove(struct device *dev)
 
        sdhc = sdhcinfo;
        drvinfo.detach(sdhc->ch);
-       bcmsdh_detach(sdhc->osh, sdhc->sdh);
+       bcmsdh_detach(sdhc->sdh);
        /* find the SDIO Host Controller state for this pdev
                 and take it out from the list */
        for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
index 4409443c69de8b5188a13bd0c189158e25a3b610..9b5075e5bfb15529de24c647db829f7dacce547f 100644 (file)
@@ -174,7 +174,7 @@ extern sdioh_info_t *sdioh_attach(struct osl_info *osh, void *bar0, uint irq)
        return sd;
 }
 
-extern SDIOH_API_RC sdioh_detach(struct osl_info *osh, sdioh_info_t *sd)
+extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
 {
        sd_trace(("%s\n", __func__));
 
index cd0d5400bf0725f5eff813f5e8aab114525b4124..065f1aeb6ca9ccc11cc72d715468ffa2873f2e5a 100644 (file)
@@ -27,7 +27,7 @@ extern void dhd_bus_unregister(void);
 
 /* Download firmware image and nvram image */
 extern bool dhd_bus_download_firmware(struct dhd_bus *bus,
-             struct osl_info *osh, char *fw_path, char *nv_path);
+                                     char *fw_path, char *nv_path);
 
 /* Stop bus module: clear pending frames, disable data flow */
 extern void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
index 3efc17a0a4e01421f98ec2864b82e22ed47e5967..50415101e4c7459458eb7dbfc4f3a21bf95c12a0 100644 (file)
@@ -2125,7 +2125,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
 
        /* try to download image and nvram to the dongle */
        if (dhd->pub.busstate == DHD_BUS_DOWN) {
-               if (!(dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh,
+               if (!(dhd_bus_download_firmware(dhd->pub.bus,
                                                fw_path, nv_path))) {
                        DHD_ERROR(("%s: dhdsdio_probe_download failed. "
                                "firmware = %s nvram = %s\n",
index 32551a24b4bed5ad9b82edb637cdb3f0bbb072c2..e85d2d216734ff23a4d087f23479f88741e03e0a 100644 (file)
@@ -437,15 +437,14 @@ static int dhdsdio_mem_dump(dhd_bus_t *bus);
 static int dhdsdio_download_state(dhd_bus_t *bus, bool enter);
 
 static void dhdsdio_release(dhd_bus_t *bus, struct osl_info *osh);
-static void dhdsdio_release_malloc(dhd_bus_t *bus, struct osl_info *osh);
+static void dhdsdio_release_malloc(dhd_bus_t *bus);
 static void dhdsdio_disconnect(void *ptr);
 static bool dhdsdio_chipmatch(u16 chipid);
-static bool dhdsdio_probe_attach(dhd_bus_t *bus, struct osl_info *osh,
-                                void *sdh, void *regsva, u16 devid);
-static bool dhdsdio_probe_malloc(dhd_bus_t *bus, struct osl_info *osh,
-                                void *sdh);
-static bool dhdsdio_probe_init(dhd_bus_t *bus, struct osl_info *osh, void *sdh);
-static void dhdsdio_release_dongle(dhd_bus_t *bus, struct osl_info * osh);
+static bool dhdsdio_probe_attach(dhd_bus_t *bus, void *sdh,
+                                void *regsva, u16 devid);
+static bool dhdsdio_probe_malloc(dhd_bus_t *bus, void *sdh);
+static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh);
+static void dhdsdio_release_dongle(dhd_bus_t *bus);
 
 static uint process_nvram_vars(char *varbuf, uint len);
 
@@ -459,8 +458,7 @@ static int dhd_bcmsdh_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
                               struct sk_buff *pkt, bcmsdh_cmplt_fn_t complete,
                               void *handle);
 
-static bool dhdsdio_download_firmware(struct dhd_bus *bus, struct osl_info *osh,
-                                     void *sdh);
+static bool dhdsdio_download_firmware(struct dhd_bus *bus, void *sdh);
 static int _dhdsdio_download_firmware(struct dhd_bus *bus);
 
 static int dhdsdio_download_code_file(struct dhd_bus *bus, char *image_path);
@@ -5172,7 +5170,7 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
                                         else use locally malloced rxbuf */
 
        /* attempt to attach to the dongle */
-       if (!(dhdsdio_probe_attach(bus, osh, sdh, regsva, devid))) {
+       if (!(dhdsdio_probe_attach(bus, sdh, regsva, devid))) {
                DHD_ERROR(("%s: dhdsdio_probe_attach failed\n", __func__));
                goto fail;
        }
@@ -5185,12 +5183,12 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
        }
 
        /* Allocate buffers */
-       if (!(dhdsdio_probe_malloc(bus, osh, sdh))) {
+       if (!(dhdsdio_probe_malloc(bus, sdh))) {
                DHD_ERROR(("%s: dhdsdio_probe_malloc failed\n", __func__));
                goto fail;
        }
 
-       if (!(dhdsdio_probe_init(bus, osh, sdh))) {
+       if (!(dhdsdio_probe_init(bus, sdh))) {
                DHD_ERROR(("%s: dhdsdio_probe_init failed\n", __func__));
                goto fail;
        }
@@ -5231,8 +5229,7 @@ fail:
 }
 
 static bool
-dhdsdio_probe_attach(struct dhd_bus *bus, struct osl_info *osh, void *sdh,
-                       void *regsva, u16 devid)
+dhdsdio_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, u16 devid)
 {
        u8 clkctl = 0;
        int err = 0;
@@ -5389,8 +5386,7 @@ fail:
        return false;
 }
 
-static bool dhdsdio_probe_malloc(dhd_bus_t *bus, struct osl_info *osh,
-                                void *sdh)
+static bool dhdsdio_probe_malloc(dhd_bus_t *bus, void *sdh)
 {
        DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -5431,7 +5427,7 @@ fail:
        return false;
 }
 
-static bool dhdsdio_probe_init(dhd_bus_t *bus, struct osl_info *osh, void *sdh)
+static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
 {
        s32 fnum;
 
@@ -5508,20 +5504,19 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, struct osl_info *osh, void *sdh)
 }
 
 bool
-dhd_bus_download_firmware(struct dhd_bus *bus, struct osl_info *osh,
-                         char *fw_path, char *nv_path)
+dhd_bus_download_firmware(struct dhd_bus *bus, char *fw_path, char *nv_path)
 {
        bool ret;
        bus->fw_path = fw_path;
        bus->nv_path = nv_path;
 
-       ret = dhdsdio_download_firmware(bus, osh, bus->sdh);
+       ret = dhdsdio_download_firmware(bus, bus->sdh);
 
        return ret;
 }
 
 static bool
-dhdsdio_download_firmware(struct dhd_bus *bus, struct osl_info *osh, void *sdh)
+dhdsdio_download_firmware(struct dhd_bus *bus, void *sdh)
 {
        bool ret;
 
@@ -5541,21 +5536,19 @@ static void dhdsdio_release(dhd_bus_t *bus, struct osl_info *osh)
        DHD_TRACE(("%s: Enter\n", __func__));
 
        if (bus) {
-               ASSERT(osh);
-
                /* De-register interrupt handler */
                bcmsdh_intr_disable(bus->sdh);
                bcmsdh_intr_dereg(bus->sdh);
 
                if (bus->dhd) {
 
-                       dhdsdio_release_dongle(bus, osh);
+                       dhdsdio_release_dongle(bus);
 
                        dhd_detach(bus->dhd);
                        bus->dhd = NULL;
                }
 
-               dhdsdio_release_malloc(bus, osh);
+               dhdsdio_release_malloc(bus);
 
                kfree(bus);
        }
@@ -5566,7 +5559,7 @@ static void dhdsdio_release(dhd_bus_t *bus, struct osl_info *osh)
        DHD_TRACE(("%s: Disconnected\n", __func__));
 }
 
-static void dhdsdio_release_malloc(dhd_bus_t *bus, struct osl_info *osh)
+static void dhdsdio_release_malloc(dhd_bus_t *bus)
 {
        DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -5585,7 +5578,7 @@ static void dhdsdio_release_malloc(dhd_bus_t *bus, struct osl_info *osh)
        }
 }
 
-static void dhdsdio_release_dongle(dhd_bus_t *bus, struct osl_info *osh)
+static void dhdsdio_release_dongle(dhd_bus_t *bus)
 {
        DHD_TRACE(("%s: Enter\n", __func__));
 
@@ -6057,7 +6050,7 @@ int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag)
 
                        /* Clean tx/rx buffer pointers,
                         detach from the dongle */
-                       dhdsdio_release_dongle(bus, bus->dhd->osh);
+                       dhdsdio_release_dongle(bus);
 
                        bus->dhd->dongle_reset = true;
                        bus->dhd->up = false;
@@ -6077,14 +6070,13 @@ int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag)
                        bcmsdh_reset(bus->sdh);
 
                        /* Attempt to re-attach & download */
-                       if (dhdsdio_probe_attach(bus, bus->dhd->osh, bus->sdh,
+                       if (dhdsdio_probe_attach(bus, bus->sdh,
                                                 (u32 *) SI_ENUM_BASE,
                                                 bus->cl_devid)) {
                                /* Attempt to download binary to the dongle */
                                if (dhdsdio_probe_init
-                                   (bus, bus->dhd->osh, bus->sdh)
+                                   (bus, bus->sdh)
                                    && dhdsdio_download_firmware(bus,
-                                                                bus->dhd->osh,
                                                                 bus->sdh)) {
 
                                        /* Re-init bus, enable F2 transfer */
index 96c629267f14d7cb96f942a67d51593f56ae4311..d27d1cbb7f790c153d0f0a2142069166b4b65b0c 100644 (file)
@@ -53,7 +53,7 @@ extern bcmsdh_info_t *bcmsdh_attach(struct osl_info *osh, void *cfghdl,
                                    void **regsva, uint irq);
 
 /* Detach - freeup resources allocated in attach */
-extern int bcmsdh_detach(struct osl_info *osh, void *sdh);
+extern int bcmsdh_detach(void *sdh);
 
 /* Query if SD device interrupts are enabled */
 extern bool bcmsdh_intr_query(void *sdh);