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

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
...@@ -1045,10 +1045,9 @@ static int ks_wlan_set_power(struct net_device *dev, ...@@ -1045,10 +1045,9 @@ static int ks_wlan_set_power(struct net_device *dev,
if (vwrq->power.disabled) { if (vwrq->power.disabled) {
priv->reg.power_mgmt = POWER_MGMT_ACTIVE; priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
} else { } else {
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) if (priv->reg.operation_mode != MODE_INFRASTRUCTURE)
priv->reg.power_mgmt = POWER_MGMT_SAVE1;
else
return -EINVAL; return -EINVAL;
priv->reg.power_mgmt = POWER_MGMT_SAVE1;
} }
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
......
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