aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2017-03-10 20:39:22 -0500
committerKalle Valo <kvalo@codeaurora.org>2017-03-16 04:14:12 -0400
commitba1c7e45ec224cc8d2df33ecaee1946d48e79231 (patch)
tree761f3ca7e08cbb0292b580cce6be98fbe46e78f2
parent4e841d3eb9294ce4137fdb5d0a88f1bceab9c212 (diff)
mwifiex: set adapter->dev before starting to use mwifiex_dbg()
The mwifiex_dbg() log handler utilizes the struct device in adapter->dev. Without it, it decides not to print anything. As of commit 2e02b5814217 ("mwifiex: Allow mwifiex early access to device structure"), we started assigning that pointer only after we finished mwifiex_register() -- this effectively neuters any mwifiex_dbg() logging done before this point. Let's move the device assignment into mwifiex_register(). Fixes: 2e02b5814217 ("mwifiex: Allow mwifiex early access to device structure") Cc: Rajat Jain <rajatja@google.com> Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/marvell/mwifiex/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 5ebca1d0cfc7..43d040e02e4d 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -57,8 +57,8 @@ MODULE_PARM_DESC(mfg_mode, "manufacturing mode enable:1, disable:0");
57 * In case of any errors during inittialization, this function also ensures 57 * In case of any errors during inittialization, this function also ensures
58 * proper cleanup before exiting. 58 * proper cleanup before exiting.
59 */ 59 */
60static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, 60static int mwifiex_register(void *card, struct device *dev,
61 void **padapter) 61 struct mwifiex_if_ops *if_ops, void **padapter)
62{ 62{
63 struct mwifiex_adapter *adapter; 63 struct mwifiex_adapter *adapter;
64 int i; 64 int i;
@@ -68,6 +68,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
68 return -ENOMEM; 68 return -ENOMEM;
69 69
70 *padapter = adapter; 70 *padapter = adapter;
71 adapter->dev = dev;
71 adapter->card = card; 72 adapter->card = card;
72 73
73 /* Save interface specific operations in adapter */ 74 /* Save interface specific operations in adapter */
@@ -1568,12 +1569,11 @@ mwifiex_add_card(void *card, struct completion *fw_done,
1568{ 1569{
1569 struct mwifiex_adapter *adapter; 1570 struct mwifiex_adapter *adapter;
1570 1571
1571 if (mwifiex_register(card, if_ops, (void **)&adapter)) { 1572 if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) {
1572 pr_err("%s: software init failed\n", __func__); 1573 pr_err("%s: software init failed\n", __func__);
1573 goto err_init_sw; 1574 goto err_init_sw;
1574 } 1575 }
1575 1576
1576 adapter->dev = dev;
1577 mwifiex_probe_of(adapter); 1577 mwifiex_probe_of(adapter);
1578 1578
1579 adapter->iface_type = iface_type; 1579 adapter->iface_type = iface_type;