OSDN Git Service

mwifiex: reunite copy-and-pasted remove/reset code
authorBrian Norris <briannorris@chromium.org>
Tue, 25 Jul 2017 01:13:17 +0000 (18:13 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 28 Jul 2017 14:47:45 +0000 (17:47 +0300)
commitb6658b66d8a6eaaf216382c19d016116931a0f63
treec471221e54e931fba663be892228fa37fe95e190
parente6249e15fea2f915ddfcbee8efd9120cb64ed93d
mwifiex: reunite copy-and-pasted remove/reset code

When PCIe FLR code was added, it explicitly copy-and-pasted much of
mwifiex_remove_card() into mwifiex_shutdown_sw(). This is unnecessary,
as almost all of the code should be reused.

Let's reunite what we can for now.

The only functional changes for now:

 * call netif_device_detach() in the remove() code path -- this wasn't
   done before, but it really should be a no-op, when the device is
   getting totally unregistered soon anyway

 * call the ->down_dev() driver callback only after we've finished all
   SW teardown -- this should have no significant effect, since the only
   user (pcie.c) does very minimal work there, and it doesn't matter
   that we reorder this

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/main.c