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: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
afa10db0e1
commit
f3b0bd2395
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user