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: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sergio Paracuellos
2018-04-19 07:08:02 +02:00
committed by Greg Kroah-Hartman
parent 86357f794b
commit 6519967b95

View File

@@ -2224,11 +2224,10 @@ static int ks_wlan_set_wps_enable(struct net_device *dev,
if (priv->sleep_mode == SLP_SLEEP)
return -EPERM;
/* for SLEEP MODE */
if (*uwrq == 0 || *uwrq == 1)
priv->wps.wps_enabled = *uwrq;
else
if (*uwrq != 0 && *uwrq != 1)
return -EINVAL;
priv->wps.wps_enabled = *uwrq;
hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST);
return 0;