]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: wfx: simplify wfx_config()
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 15 Jan 2020 13:54:23 +0000 (13:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 19:59:47 +0000 (20:59 +0100)
Now that wfx_config() only handles IEEE80211_CONF_CHANGE_PS, it can be
simplified.

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

index a0f19d33e972daf885146cf8ab6624881497cc20..451d0108a1b024f4bd5dd194843ddcbfccc9f968 100644 (file)
@@ -1230,22 +1230,13 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed)
        struct wfx_dev *wdev = hw->priv;
        struct wfx_vif *wvif;
 
-       // FIXME: Interface id should not been hardcoded
-       wvif = wdev_to_wvif(wdev, 0);
-       if (!wvif) {
-               WARN(1, "interface 0 does not exist anymore");
-               return 0;
-       }
-
-       mutex_lock(&wdev->conf_mutex);
        if (changed & IEEE80211_CONF_CHANGE_PS) {
+               mutex_lock(&wdev->conf_mutex);
                wvif = NULL;
                while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
                        ret = wfx_update_pm(wvif);
-               wvif = wdev_to_wvif(wdev, 0);
+               mutex_unlock(&wdev->conf_mutex);
        }
-
-       mutex_unlock(&wdev->conf_mutex);
        return ret;
 }