Commit 9917124f authored by Franky Lin's avatar Franky Lin Committed by Greg Kroah-Hartman

staging: brcm80211: absorb brcmf_sdcard_detach into brcmf_sdio_remove

To increase code readability of brcmfmac
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0f188ea3
...@@ -57,19 +57,6 @@ static struct brcmf_sdioh_driver drvinfo = { NULL, NULL }; ...@@ -57,19 +57,6 @@ static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
module_param(sd_f2_blocksize, int, 0); module_param(sd_f2_blocksize, int, 0);
int brcmf_sdcard_detach(struct brcmf_sdio_card *card)
{
if (card != NULL) {
if (card->sdioh) {
brcmf_sdioh_detach(card->sdioh);
card->sdioh = NULL;
}
kfree(card);
}
return 0;
}
int int
brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name, brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
void *params, int plen, void *arg, int len, bool set) void *params, int plen, void *arg, int len, bool set)
...@@ -441,7 +428,6 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -441,7 +428,6 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
sdiodev->card->sdioh = brcmf_sdioh_attach((void *)0); sdiodev->card->sdioh = brcmf_sdioh_attach((void *)0);
if (!sdiodev->card->sdioh) { if (!sdiodev->card->sdioh) {
brcmf_sdcard_detach(sdiodev->card);
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
...@@ -466,8 +452,8 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -466,8 +452,8 @@ int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
} }
out: out:
if ((ret) && (sdiodev->card)) if (ret)
brcmf_sdcard_detach(sdiodev->card); brcmf_sdio_remove(sdiodev);
return ret; return ret;
} }
...@@ -475,8 +461,18 @@ EXPORT_SYMBOL(brcmf_sdio_probe); ...@@ -475,8 +461,18 @@ EXPORT_SYMBOL(brcmf_sdio_probe);
int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev) int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev)
{ {
if (sdiodev->bus) {
drvinfo.detach(sdiodev->bus); drvinfo.detach(sdiodev->bus);
brcmf_sdcard_detach(sdiodev->card); sdiodev->bus = NULL;
}
if (sdiodev->card) {
if (sdiodev->card->sdioh)
brcmf_sdioh_detach(sdiodev->card->sdioh);
kfree(sdiodev->card);
sdiodev->card = NULL;
}
return 0; return 0;
} }
EXPORT_SYMBOL(brcmf_sdio_remove); EXPORT_SYMBOL(brcmf_sdio_remove);
......
...@@ -136,9 +136,6 @@ struct brcmf_sdio_dev { ...@@ -136,9 +136,6 @@ struct brcmf_sdio_dev {
void *bus; void *bus;
}; };
/* Detach - freeup resources allocated in attach */
extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
/* Enable/disable SD interrupt */ /* Enable/disable SD interrupt */
extern int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card); extern int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card);
extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card); extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);
......
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