brcmfmac: remove brcmf_sdio_disconnect() function
authorArend van Spriel <arend@broadcom.com>
Thu, 12 Dec 2013 10:59:05 +0000 (11:59 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 18 Dec 2013 20:22:59 +0000 (15:22 -0500)
Instead of calling brcmf_sdio_disconnect() expose brcmf_sdio_remove()
and call it directly.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h

index a4dae21ef9a38ac922aad97f4067637bce1ba46e..7550f9f1211f1256fec60ec9762b72af8b2e4697 100644 (file)
@@ -901,7 +901,7 @@ static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev)
        sdiodev->bus_if->state = BRCMF_BUS_DOWN;
 
        if (sdiodev->bus) {
-               brcmf_sdio_disconnect(sdiodev->bus);
+               brcmf_sdio_remove(sdiodev->bus);
                sdiodev->bus = NULL;
        }
 
index f3069b47fcf40f7523af3b64eabff9e175ad9eab..f214510e3beec2d37ca8684b4d278474abcf4795 100644 (file)
@@ -3973,33 +3973,6 @@ static void brcmf_sdio_release_dongle(struct brcmf_sdio *bus)
        brcmf_dbg(TRACE, "Disconnected\n");
 }
 
-/* Detach and free everything */
-static void brcmf_sdio_release(struct brcmf_sdio *bus)
-{
-       brcmf_dbg(TRACE, "Enter\n");
-
-       if (bus) {
-               /* De-register interrupt handler */
-               brcmf_sdiod_intr_unregister(bus->sdiodev);
-
-               cancel_work_sync(&bus->datawork);
-               if (bus->brcmf_wq)
-                       destroy_workqueue(bus->brcmf_wq);
-
-               if (bus->sdiodev->bus_if->drvr) {
-                       brcmf_detach(bus->sdiodev->dev);
-                       brcmf_sdio_release_dongle(bus);
-               }
-
-               brcmu_pkt_buf_free_skb(bus->txglom_sgpad);
-               brcmf_sdio_release_malloc(bus);
-               kfree(bus->hdrbuf);
-               kfree(bus);
-       }
-
-       brcmf_dbg(TRACE, "Disconnected\n");
-}
-
 static struct brcmf_bus_ops brcmf_sdio_bus_ops = {
        .stop = brcmf_sdio_bus_stop,
        .preinit = brcmf_sdio_bus_preinit,
@@ -4116,15 +4089,33 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
        return bus;
 
 fail:
-       brcmf_sdio_release(bus);
+       brcmf_sdio_remove(bus);
        return NULL;
 }
 
-void brcmf_sdio_disconnect(struct brcmf_sdio *bus)
+/* Detach and free everything */
+void brcmf_sdio_remove(struct brcmf_sdio *bus)
 {
        brcmf_dbg(TRACE, "Enter\n");
 
-       brcmf_sdio_release(bus);
+       if (bus) {
+               /* De-register interrupt handler */
+               brcmf_sdiod_intr_unregister(bus->sdiodev);
+
+               cancel_work_sync(&bus->datawork);
+               if (bus->brcmf_wq)
+                       destroy_workqueue(bus->brcmf_wq);
+
+               if (bus->sdiodev->bus_if->drvr) {
+                       brcmf_detach(bus->sdiodev->dev);
+                       brcmf_sdio_release_dongle(bus);
+               }
+
+               brcmu_pkt_buf_free_skb(bus->txglom_sgpad);
+               brcmf_sdio_release_malloc(bus);
+               kfree(bus->hdrbuf);
+               kfree(bus);
+       }
 
        brcmf_dbg(TRACE, "Disconnected\n");
 }
index e28498ed3520b9408e6ad0dd80e5f6b9ad69d007..a0981b32c729d14c98d80487c36d1b6d8e9a29c6 100644 (file)
@@ -236,7 +236,7 @@ int brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
 int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
 
 struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
-void brcmf_sdio_disconnect(struct brcmf_sdio *bus);
+void brcmf_sdio_remove(struct brcmf_sdio *bus);
 void brcmf_sdio_isr(struct brcmf_sdio *bus);
 
 void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint wdtick);