staging: wfx: simplify the check if the the device is associated
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 20 Apr 2020 16:02:56 +0000 (18:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 11:26:02 +0000 (13:26 +0200)
Firmware dislikes the driver enables PS when it is not yet associated.
The current check for that condition is more complex than necessary.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200420160311.57323-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/sta.c

index c73dbb3..c0c3eb9 100644 (file)
@@ -263,7 +263,7 @@ static int wfx_update_pm(struct wfx_vif *wvif)
        struct ieee80211_channel *chan0 = NULL, *chan1 = NULL;
 
        WARN_ON(conf->dynamic_ps_timeout < 0);
-       if (wvif->state != WFX_STATE_STA || !wvif->bss_params.aid)
+       if (!wvif->vif->bss_conf.assoc)
                return 0;
        if (!ps)
                ps_timeout = 0;