mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 10:38:44 -04:00
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:
committed by
Greg Kroah-Hartman
parent
86357f794b
commit
6519967b95
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user