diff options
author | Arend van Spriel <arend@broadcom.com> | 2014-01-06 06:40:39 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-01-06 15:48:00 -0500 |
commit | bfad4a048c44c37ce4c606ad3f6a745607d515e9 (patch) | |
tree | 4007c8998c9a3bfb7c99731e689fe27b4ce5012b /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |
parent | d453399229cefff985391f079066ac5a84955537 (diff) |
brcmfmac: cleanup helper functions in sdio remove path
Two helper functions in the sdio remove path were very thin and
only used once. So its code is moved to the calling function.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index f214510e3bee..27fbcbf82afb 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -3750,15 +3750,6 @@ static void brcmf_sdio_dataworker(struct work_struct *work) | |||
3750 | } | 3750 | } |
3751 | } | 3751 | } |
3752 | 3752 | ||
3753 | static void brcmf_sdio_release_malloc(struct brcmf_sdio *bus) | ||
3754 | { | ||
3755 | brcmf_dbg(TRACE, "Enter\n"); | ||
3756 | |||
3757 | kfree(bus->rxbuf); | ||
3758 | bus->rxctl = bus->rxbuf = NULL; | ||
3759 | bus->rxlen = 0; | ||
3760 | } | ||
3761 | |||
3762 | static bool brcmf_sdio_probe_malloc(struct brcmf_sdio *bus) | 3753 | static bool brcmf_sdio_probe_malloc(struct brcmf_sdio *bus) |
3763 | { | 3754 | { |
3764 | brcmf_dbg(TRACE, "Enter\n"); | 3755 | brcmf_dbg(TRACE, "Enter\n"); |
@@ -3955,24 +3946,6 @@ brcmf_sdio_watchdog(unsigned long data) | |||
3955 | } | 3946 | } |
3956 | } | 3947 | } |
3957 | 3948 | ||
3958 | static void brcmf_sdio_release_dongle(struct brcmf_sdio *bus) | ||
3959 | { | ||
3960 | brcmf_dbg(TRACE, "Enter\n"); | ||
3961 | |||
3962 | if (bus->ci) { | ||
3963 | sdio_claim_host(bus->sdiodev->func[1]); | ||
3964 | brcmf_sdio_clkctl(bus, CLK_AVAIL, false); | ||
3965 | brcmf_sdio_clkctl(bus, CLK_NONE, false); | ||
3966 | sdio_release_host(bus->sdiodev->func[1]); | ||
3967 | brcmf_sdio_chip_detach(&bus->ci); | ||
3968 | if (bus->vars && bus->varsz) | ||
3969 | kfree(bus->vars); | ||
3970 | bus->vars = NULL; | ||
3971 | } | ||
3972 | |||
3973 | brcmf_dbg(TRACE, "Disconnected\n"); | ||
3974 | } | ||
3975 | |||
3976 | static struct brcmf_bus_ops brcmf_sdio_bus_ops = { | 3949 | static struct brcmf_bus_ops brcmf_sdio_bus_ops = { |
3977 | .stop = brcmf_sdio_bus_stop, | 3950 | .stop = brcmf_sdio_bus_stop, |
3978 | .preinit = brcmf_sdio_bus_preinit, | 3951 | .preinit = brcmf_sdio_bus_preinit, |
@@ -4108,12 +4081,20 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) | |||
4108 | 4081 | ||
4109 | if (bus->sdiodev->bus_if->drvr) { | 4082 | if (bus->sdiodev->bus_if->drvr) { |
4110 | brcmf_detach(bus->sdiodev->dev); | 4083 | brcmf_detach(bus->sdiodev->dev); |
4111 | brcmf_sdio_release_dongle(bus); | 4084 | } |
4085 | |||
4086 | if (bus->ci) { | ||
4087 | sdio_claim_host(bus->sdiodev->func[1]); | ||
4088 | brcmf_sdio_clkctl(bus, CLK_AVAIL, false); | ||
4089 | brcmf_sdio_clkctl(bus, CLK_NONE, false); | ||
4090 | sdio_release_host(bus->sdiodev->func[1]); | ||
4091 | brcmf_sdio_chip_detach(&bus->ci); | ||
4112 | } | 4092 | } |
4113 | 4093 | ||
4114 | brcmu_pkt_buf_free_skb(bus->txglom_sgpad); | 4094 | brcmu_pkt_buf_free_skb(bus->txglom_sgpad); |
4115 | brcmf_sdio_release_malloc(bus); | 4095 | kfree(bus->rxbuf); |
4116 | kfree(bus->hdrbuf); | 4096 | kfree(bus->hdrbuf); |
4097 | kfree(bus->vars); | ||
4117 | kfree(bus); | 4098 | kfree(bus); |
4118 | } | 4099 | } |
4119 | 4100 | ||