diff mbox series

[22/31] wifi: mwifiex: pass adapter to mwifiex_init_shutdown_fw()

Message ID 20240820-mwifiex-cleanup-v1-22-320d8de4a4b7@pengutronix.de
State New
Headers show
Series wifi: mwifiex: cleanup driver | expand

Commit Message

Sascha Hauer Aug. 20, 2024, 11:55 a.m. UTC
mwifiex_init_shutdown_fw() shuts down the firmware of the whole adapter,
not of a single priv, so pass the adapter to this function and use
mwifiex_adapter_send_cmd().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 5 +----
 drivers/net/wireless/marvell/mwifiex/main.h | 2 +-
 drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +-
 drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
 drivers/net/wireless/marvell/mwifiex/usb.c  | 4 +---
 drivers/net/wireless/marvell/mwifiex/util.c | 6 +++---
 6 files changed, 8 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index f42d537cc6ce0..8978934b1115e 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1493,8 +1493,6 @@  static void mwifiex_uninit_sw(struct mwifiex_adapter *adapter)
  */
 int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter)
 {
-	struct mwifiex_private *priv;
-
 	if (!adapter)
 		return 0;
 
@@ -1502,10 +1500,9 @@  int mwifiex_shutdown_sw(struct mwifiex_adapter *adapter)
 	/* Caller should ensure we aren't suspending while this happens */
 	reinit_completion(adapter->fw_done);
 
-	priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
 	mwifiex_deauthenticate_all(adapter);
 
-	mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
+	mwifiex_init_shutdown_fw(adapter, MWIFIEX_FUNC_SHUTDOWN);
 
 	mwifiex_uninit_sw(adapter);
 	adapter->is_up = false;
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index cb3a52c0869c9..114e0141dc01a 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -1436,7 +1436,7 @@  static inline void mwifiex_enable_wake(struct mwifiex_adapter *adapter)
 	}
 }
 
-int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
+int mwifiex_init_shutdown_fw(struct mwifiex_adapter *adapter,
 			     u32 func_init_shutdown);
 
 int mwifiex_add_card(void *card, struct completion *fw_done,
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index a25f90034e38d..2a7ed2aad1a34 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -452,7 +452,7 @@  static void mwifiex_pcie_remove(struct pci_dev *pdev)
 
 		mwifiex_disable_auto_ds(priv);
 
-		mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
+		mwifiex_init_shutdown_fw(adapter, MWIFIEX_FUNC_SHUTDOWN);
 	}
 
 	mwifiex_remove_card(adapter);
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 18ed5015064db..e3a995514efc7 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -867,7 +867,7 @@  mwifiex_sdio_remove(struct sdio_func *func)
 
 		priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
 		mwifiex_disable_auto_ds(priv);
-		mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
+		mwifiex_init_shutdown_fw(adapter, MWIFIEX_FUNC_SHUTDOWN);
 	}
 
 	mwifiex_remove_card(adapter);
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index 520ea4bc9a3fb..e082c26003cd7 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -656,9 +656,7 @@  static void mwifiex_usb_disconnect(struct usb_interface *intf)
 	if (card->udev->state != USB_STATE_NOTATTACHED && !adapter->mfg_mode) {
 		mwifiex_deauthenticate_all(adapter);
 
-		mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter,
-							  MWIFIEX_BSS_ROLE_ANY),
-					 MWIFIEX_FUNC_SHUTDOWN);
+		mwifiex_init_shutdown_fw(adapter, MWIFIEX_FUNC_SHUTDOWN);
 	}
 
 	mwifiex_dbg(adapter, FATAL,
diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
index 078877161ab7c..a8c44cc14f8a2 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.c
+++ b/drivers/net/wireless/marvell/mwifiex/util.c
@@ -137,7 +137,7 @@  int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter)
  * This function sends init/shutdown command
  * to firmware.
  */
-int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
+int mwifiex_init_shutdown_fw(struct mwifiex_adapter *adapter,
 			     u32 func_init_shutdown)
 {
 	u16 cmd;
@@ -147,12 +147,12 @@  int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
 	} else if (func_init_shutdown == MWIFIEX_FUNC_SHUTDOWN) {
 		cmd = HostCmd_CMD_FUNC_SHUTDOWN;
 	} else {
-		mwifiex_dbg(priv->adapter, ERROR,
+		mwifiex_dbg(adapter, ERROR,
 			    "unsupported parameter\n");
 		return -1;
 	}
 
-	return mwifiex_send_cmd(priv, cmd, HostCmd_ACT_GEN_SET, 0, NULL, true);
+	return mwifiex_adapter_send_cmd(adapter, cmd, HostCmd_ACT_GEN_SET, 0, NULL, true);
 }
 EXPORT_SYMBOL_GPL(mwifiex_init_shutdown_fw);