Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Brian Norris and committed by
Kalle Valo
ba1c7e45 4e841d3e

+4 -4
+4 -4
drivers/net/wireless/marvell/mwifiex/main.c
··· 57 57 * In case of any errors during inittialization, this function also ensures 58 58 * proper cleanup before exiting. 59 59 */ 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) 62 62 { 63 63 struct mwifiex_adapter *adapter; 64 64 int i; ··· 68 68 return -ENOMEM; 69 69 70 70 *padapter = adapter; 71 + adapter->dev = dev; 71 72 adapter->card = card; 72 73 73 74 /* Save interface specific operations in adapter */ ··· 1569 1568 { 1570 1569 struct mwifiex_adapter *adapter; 1571 1570 1572 - if (mwifiex_register(card, if_ops, (void **)&adapter)) { 1571 + if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) { 1573 1572 pr_err("%s: software init failed\n", __func__); 1574 1573 goto err_init_sw; 1575 1574 } 1576 1575 1577 - adapter->dev = dev; 1578 1576 mwifiex_probe_of(adapter); 1579 1577 1580 1578 adapter->iface_type = iface_type;