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
brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
void *params, int plen, void *arg, int len, bool set)
sdiodev->card->sdioh = brcmf_sdioh_attach((void *)0);
if (!sdiodev->card->sdioh) {
- brcmf_sdcard_detach(sdiodev->card);
ret = -ENODEV;
goto out;
}
}
out:
- if ((ret) && (sdiodev->card))
- brcmf_sdcard_detach(sdiodev->card);
+ if (ret)
+ brcmf_sdio_remove(sdiodev);
return ret;
}
int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev)
{
- drvinfo.detach(sdiodev->bus);
- brcmf_sdcard_detach(sdiodev->card);
+ if (sdiodev->bus) {
+ drvinfo.detach(sdiodev->bus);
+ sdiodev->bus = NULL;
+ }
+
+ if (sdiodev->card) {
+ if (sdiodev->card->sdioh)
+ brcmf_sdioh_detach(sdiodev->card->sdioh);
+ kfree(sdiodev->card);
+ sdiodev->card = NULL;
+ }
+
return 0;
}
EXPORT_SYMBOL(brcmf_sdio_remove);
void *bus;
};
-/* Detach - freeup resources allocated in attach */
-extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
-
/* Enable/disable SD interrupt */
extern int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card);
extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);