mwifiex: fall back mwifiex_dbg to pr_info when adapter->dev not set
authorXinming Hu <huxm@marvell.com>
Thu, 13 Apr 2017 06:48:20 +0000 (06:48 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 20 Apr 2017 07:18:07 +0000 (10:18 +0300)
mwifiex_dbg will do nothing before adapter->dev get assigned. several logs
lost in this case. it can be avoided by fall back to pr_info.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/main.c

index 3d59d74c7f9975676cb3c01fe0f291b320b3a093..cd21bbf4412f74da8ab86962c042bf46bb6c7fbe 100644 (file)
@@ -1753,7 +1753,7 @@ void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
        struct va_format vaf;
        va_list args;
 
-       if (!adapter->dev || !(adapter->debug_mask & mask))
+       if (!(adapter->debug_mask & mask))
                return;
 
        va_start(args, fmt);
@@ -1761,7 +1761,10 @@ void _mwifiex_dbg(const struct mwifiex_adapter *adapter, int mask,
        vaf.fmt = fmt;
        vaf.va = &args;
 
-       dev_info(adapter->dev, "%pV", &vaf);
+       if (adapter->dev)
+               dev_info(adapter->dev, "%pV", &vaf);
+       else
+               pr_info("%pV", &vaf);
 
        va_end(args);
 }