Commit 6519967b authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: refactor ks_wlan_set_wps_enable function

This commit refactors ks_wlan_set_wps_enable function to
improve readability handling the error first to avoid an
'else'.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 86357f79
...@@ -2224,11 +2224,10 @@ static int ks_wlan_set_wps_enable(struct net_device *dev, ...@@ -2224,11 +2224,10 @@ static int ks_wlan_set_wps_enable(struct net_device *dev,
if (priv->sleep_mode == SLP_SLEEP) if (priv->sleep_mode == SLP_SLEEP)
return -EPERM; return -EPERM;
/* for SLEEP MODE */ /* for SLEEP MODE */
if (*uwrq == 0 || *uwrq == 1) if (*uwrq != 0 && *uwrq != 1)
priv->wps.wps_enabled = *uwrq;
else
return -EINVAL; return -EINVAL;
priv->wps.wps_enabled = *uwrq;
hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST); hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment