diff mbox series

[2/4] wifi: mwifiex: let mwifiex_init_fw() return 0 for success

Message ID 20250410-mwifiex-drop-asynchronous-init-v1-2-6a212fa9185e@pengutronix.de (mailing list archive)
State New
Delegated to: Johannes Berg
Headers show
Series wifi: mwifiex: drop asynchronous init waiting code | expand

Checks

Context Check Description
wifibot/fixes_present success Fixes tag not required for -next series
wifibot/series_format warning Target tree name not specified in the subject
wifibot/tree_selection success Guessed tree name to be wireless-next
wifibot/ynl success Generated files up to date; no warnings/errors; no diff in generated;
wifibot/build_32bit success Errors and warnings before: 1 this patch: 1
wifibot/build_allmodconfig_warn fail Errors and warnings before: 10 this patch: 10
wifibot/build_clang fail Errors and warnings before: 13 this patch: 13
wifibot/build_clang_rust success No Rust files in patch. Skipping build
wifibot/build_tools success No tools touched, skip
wifibot/check_selftest success No net selftest shell script
wifibot/checkpatch warning WARNING: 'sucess' may be misspelled - perhaps 'success'?
wifibot/deprecated_api success None detected
wifibot/header_inline success No static functions without inline keyword in header files
wifibot/kdoc success Errors and warnings before: 0 this patch: 0
wifibot/source_inline success Was 0 now: 0
wifibot/verify_fixes success No Fixes tag
wifibot/verify_signedoff success Signed-off-by tag matches author and committer

Commit Message

Sascha Hauer April 10, 2025, 10:28 a.m. UTC
mwifiex_sta_init_cmd() returns -EINPROGRESS as sucess indication when
the init param is true. Likewise mwifiex_init_fw() returns -EINPROGRESS
as success indication: It will either return -EINPROGRESS directly when
in mfg_mode or the return value of mwifiex_sta_init_cmd() when in normal
mode.

-EINPROGRESS is a leftover from times when the initialization commands
were sent asynchronously. Since 7bff9c974e1a ("mwifiex: send firmware
initialization commands synchronously") the return value has become
meaningless, so change mwifiex_sta_init_cmd() and mwifiex_init_fw()
to return 0 for success.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/wireless/marvell/mwifiex/init.c    | 3 +--
 drivers/net/wireless/marvell/mwifiex/main.c    | 7 ++-----
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 4 +---
 3 files changed, 4 insertions(+), 10 deletions(-)

Comments

Francesco Dolcini April 11, 2025, 7:58 a.m. UTC | #1
On Thu, Apr 10, 2025 at 12:28:44PM +0200, Sascha Hauer wrote:
> mwifiex_sta_init_cmd() returns -EINPROGRESS as sucess indication when
> the init param is true. Likewise mwifiex_init_fw() returns -EINPROGRESS
> as success indication: It will either return -EINPROGRESS directly when
> in mfg_mode or the return value of mwifiex_sta_init_cmd() when in normal
> mode.
> 
> -EINPROGRESS is a leftover from times when the initialization commands
> were sent asynchronously. Since 7bff9c974e1a ("mwifiex: send firmware
> initialization commands synchronously") the return value has become
> meaningless, so change mwifiex_sta_init_cmd() and mwifiex_init_fw()
> to return 0 for success.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index 7877dfe5a2233..dd24e8b140655 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -509,7 +509,6 @@  int mwifiex_init_fw(struct mwifiex_adapter *adapter)
 	}
 	if (adapter->mfg_mode) {
 		adapter->hw_status = MWIFIEX_HW_STATUS_READY;
-		ret = -EINPROGRESS;
 	} else {
 		for (i = 0; i < adapter->priv_num; i++) {
 			ret = mwifiex_sta_init_cmd(adapter->priv[i],
@@ -527,7 +526,7 @@  int mwifiex_init_fw(struct mwifiex_adapter *adapter)
 
 	adapter->hw_status = MWIFIEX_HW_STATUS_READY;
 
-	return ret;
+	return 0;
 }
 
 /*
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 0e1f539404014..3f1b8be5ad26c 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -589,12 +589,9 @@  static int _mwifiex_fw_dpc(const struct firmware *firmware, void *context)
 
 	adapter->init_wait_q_woken = false;
 	ret = mwifiex_init_fw(adapter);
-	if (ret == -1) {
+	if (ret == -1)
 		goto err_init_fw;
-	} else if (!ret) {
-		adapter->hw_status = MWIFIEX_HW_STATUS_READY;
-		goto done;
-	}
+
 	/* Wait for mwifiex_init to complete */
 	if (!adapter->mfg_mode) {
 		wait_event_interruptible(adapter->init_wait_q,
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index c4689f5a1acc8..af38744eddaa9 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -2433,11 +2433,9 @@  int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
 	ret = mwifiex_send_cmd(priv, HostCmd_CMD_11N_CFG,
 			       HostCmd_ACT_GEN_SET, 0, &tx_cfg, true);
 
-	if (init) {
+	if (init)
 		/* set last_init_cmd before sending the command */
 		priv->adapter->last_init_cmd = HostCmd_CMD_11N_CFG;
-		ret = -EINPROGRESS;
-	}
 
 	return ret;
 }