Commit ba1c7e45 authored by Brian Norris's avatar Brian Norris Committed by Kalle Valo

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 2e02b581 ("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: 2e02b581 ("mwifiex: Allow mwifiex early access to device structure")
Cc: Rajat Jain <rajatja@google.com>
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4e841d3e
...@@ -57,8 +57,8 @@ MODULE_PARM_DESC(mfg_mode, "manufacturing mode enable:1, disable:0"); ...@@ -57,8 +57,8 @@ MODULE_PARM_DESC(mfg_mode, "manufacturing mode enable:1, disable:0");
* In case of any errors during inittialization, this function also ensures * In case of any errors during inittialization, this function also ensures
* proper cleanup before exiting. * proper cleanup before exiting.
*/ */
static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, static int mwifiex_register(void *card, struct device *dev,
void **padapter) struct mwifiex_if_ops *if_ops, void **padapter)
{ {
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
int i; int i;
...@@ -68,6 +68,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, ...@@ -68,6 +68,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
return -ENOMEM; return -ENOMEM;
*padapter = adapter; *padapter = adapter;
adapter->dev = dev;
adapter->card = card; adapter->card = card;
/* Save interface specific operations in adapter */ /* Save interface specific operations in adapter */
...@@ -1568,12 +1569,11 @@ mwifiex_add_card(void *card, struct completion *fw_done, ...@@ -1568,12 +1569,11 @@ mwifiex_add_card(void *card, struct completion *fw_done,
{ {
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
if (mwifiex_register(card, if_ops, (void **)&adapter)) { if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) {
pr_err("%s: software init failed\n", __func__); pr_err("%s: software init failed\n", __func__);
goto err_init_sw; goto err_init_sw;
} }
adapter->dev = dev;
mwifiex_probe_of(adapter); mwifiex_probe_of(adapter);
adapter->iface_type = iface_type; adapter->iface_type = iface_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment