summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
diff options
context:
space:
mode:
authorArend van Spriel <arend.vanspriel@broadcom.com>2022-11-29 14:54:40 +0100
committerKalle Valo <kvalo@kernel.org>2022-12-08 16:44:06 +0200
commit76821aad49cebc69eca86800f41e8133104e91d3 (patch)
tree00475b130a687c9cca13efc2e0946651c39afcc4 /drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
parent5107778d0061db58b1683bb412418d5b3cf0b0e0 (diff)
wifi: brcmfmac: add function to unbind device to bus layer api
Introduce a new bus callback .remove() which will unbind the device from the driver. This allows the common driver layer to stop handling a device. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221129135446.151065-2-arend.vanspriel@broadcom.com
Diffstat (limited to 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 244ba48cc304..c949051c4bc4 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -4171,6 +4171,15 @@ static int brcmf_sdio_bus_reset(struct device *dev)
return 0;
}
+static void brcmf_sdio_bus_remove(struct device *dev)
+{
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
+ struct brcmf_sdio_dev *sdiod = bus_if->bus_priv.sdio;
+
+ device_release_driver(&sdiod->func2->dev);
+ device_release_driver(&sdiod->func1->dev);
+}
+
static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
.stop = brcmf_sdio_bus_stop,
.preinit = brcmf_sdio_bus_preinit,
@@ -4183,7 +4192,8 @@ static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
.get_memdump = brcmf_sdio_bus_get_memdump,
.get_blob = brcmf_sdio_get_blob,
.debugfs_create = brcmf_sdio_debugfs_create,
- .reset = brcmf_sdio_bus_reset
+ .reset = brcmf_sdio_bus_reset,
+ .remove = brcmf_sdio_bus_remove,
};
#define BRCMF_SDIO_FW_CODE 0