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

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

staging: ks7010: avoid an 'else' in ks_wlan_set_power



Change if logic to handle invalid case for operation_mode
at first avoiding an 'else' path.

Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent afa10db0
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1045,10 +1045,9 @@ static int ks_wlan_set_power(struct net_device *dev,
	if (vwrq->power.disabled) {
		priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
	} else {
		if (priv->reg.operation_mode == MODE_INFRASTRUCTURE)
			priv->reg.power_mgmt = POWER_MGMT_SAVE1;
		else
		if (priv->reg.operation_mode != MODE_INFRASTRUCTURE)
			return -EINVAL;
		priv->reg.power_mgmt = POWER_MGMT_SAVE1;
	}

	hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);