diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2025-04-23 11:21:03 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2025-04-23 16:41:52 +0300 |
commit | 2a47949b1c4db7dde20b4a1fe3ab7a2a6e5462ee (patch) | |
tree | b5f0e4052a49158df66e8dceabaabcd1e894a965 | |
parent | 659d609bdda5f9e96cbfaf8c4d0243277ca49d0f (diff) | |
download | linux-2a47949b1c4db7dde20b4a1fe3ab7a2a6e5462ee.tar.xz |
wifi: mwifiex: let mwifiex_init_fw() return 0 for success
mwifiex_sta_init_cmd() returns -EINPROGRESS as success 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 Commit 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.
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://patch.msgid.link/20250423-mwifiex-drop-asynchronous-init-v2-2-1bb951073a06@pengutronix.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/init.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/main.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 4 |
3 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 66b095225099..aa54a7874ee8 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -507,7 +507,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], @@ -525,7 +524,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 7bf29f956705..208859803b41 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -581,12 +581,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 f2e9f582ae81..5f049be24139 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c @@ -2418,11 +2418,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; } |