Commit 5f947ad9 authored by Franky Lin's avatar Franky Lin Committed by John W. Linville

brcm80211: fmac: change function brcmf_detach parameter

Change parameter to device pointer for bus layer interface function
brcmf_detach. This is part of the fullmac bus interface refactoring.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ed683c98
...@@ -703,7 +703,7 @@ extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev); ...@@ -703,7 +703,7 @@ extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len); extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len);
/* Indication from bus module regarding removal/absence of dongle */ /* Indication from bus module regarding removal/absence of dongle */
extern void brcmf_detach(struct brcmf_pub *drvr); extern void brcmf_detach(struct device *dev);
/* Indication from bus module to change flow-control state */ /* Indication from bus module to change flow-control state */
extern void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool on); extern void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool on);
......
...@@ -955,7 +955,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen, ...@@ -955,7 +955,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
fail: fail:
if (drvr) if (drvr)
brcmf_detach(drvr); brcmf_detach(dev);
return NULL; return NULL;
} }
...@@ -1093,12 +1093,14 @@ static void brcmf_bus_detach(struct brcmf_pub *drvr) ...@@ -1093,12 +1093,14 @@ static void brcmf_bus_detach(struct brcmf_pub *drvr)
} }
} }
void brcmf_detach(struct brcmf_pub *drvr) void brcmf_detach(struct device *dev)
{ {
int i;
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
struct brcmf_pub *drvr = bus_if->drvr;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
if (drvr) {
int i;
/* make sure primary interface removed last */ /* make sure primary interface removed last */
for (i = BRCMF_MAX_IFS-1; i > -1; i--) for (i = BRCMF_MAX_IFS-1; i > -1; i--)
...@@ -1113,9 +1115,8 @@ void brcmf_detach(struct brcmf_pub *drvr) ...@@ -1113,9 +1115,8 @@ void brcmf_detach(struct brcmf_pub *drvr)
if (drvr->prot) if (drvr->prot)
brcmf_proto_detach(drvr); brcmf_proto_detach(drvr);
drvr->bus_if->drvr = NULL; bus_if->drvr = NULL;
kfree(drvr); kfree(drvr);
}
} }
static int brcmf_get_pend_8021x_cnt(struct brcmf_pub *drvr) static int brcmf_get_pend_8021x_cnt(struct brcmf_pub *drvr)
......
...@@ -3865,8 +3865,8 @@ static void brcmf_sdbrcm_release(struct brcmf_sdio *bus) ...@@ -3865,8 +3865,8 @@ static void brcmf_sdbrcm_release(struct brcmf_sdio *bus)
/* De-register interrupt handler */ /* De-register interrupt handler */
brcmf_sdcard_intr_dereg(bus->sdiodev); brcmf_sdcard_intr_dereg(bus->sdiodev);
if (bus->drvr) { if (bus->sdiodev->bus_if->drvr) {
brcmf_detach(bus->drvr); brcmf_detach(bus->sdiodev->dev);
brcmf_sdbrcm_release_dongle(bus); brcmf_sdbrcm_release_dongle(bus);
bus->drvr = NULL; bus->drvr = NULL;
} }
......
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