Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -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;