Skip to content

Commit ba1c7e4

Browse files
computersforpeaceKalle Valo
authored andcommitted
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 2e02b58 ("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: 2e02b58 ("mwifiex: Allow mwifiex early access to device structure") Cc: Rajat Jain <[email protected]> Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 4e841d3 commit ba1c7e4

File tree

1 file changed

+4
-4
lines changed
  • drivers/net/wireless/marvell/mwifiex

1 file changed

+4
-4
lines changed

drivers/net/wireless/marvell/mwifiex/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ MODULE_PARM_DESC(mfg_mode, "manufacturing mode enable:1, disable:0");
5757
* In case of any errors during inittialization, this function also ensures
5858
* proper cleanup before exiting.
5959
*/
60-
static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
61-
void **padapter)
60+
static int mwifiex_register(void *card, struct device *dev,
61+
struct mwifiex_if_ops *if_ops, void **padapter)
6262
{
6363
struct mwifiex_adapter *adapter;
6464
int i;
@@ -68,6 +68,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
6868
return -ENOMEM;
6969

7070
*padapter = adapter;
71+
adapter->dev = dev;
7172
adapter->card = card;
7273

7374
/* Save interface specific operations in adapter */
@@ -1568,12 +1569,11 @@ mwifiex_add_card(void *card, struct completion *fw_done,
15681569
{
15691570
struct mwifiex_adapter *adapter;
15701571

1571-
if (mwifiex_register(card, if_ops, (void **)&adapter)) {
1572+
if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) {
15721573
pr_err("%s: software init failed\n", __func__);
15731574
goto err_init_sw;
15741575
}
15751576

1576-
adapter->dev = dev;
15771577
mwifiex_probe_of(adapter);
15781578

15791579
adapter->iface_type = iface_type;

0 commit comments

Comments
 (0)