mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
staging: ks7010: refactor ks_wlan_set_preamble function
Change if logic to handle invalid values first and just assign at the end the valid one if it is the case. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c871258052
commit
8521b4e65e
1 changed files with 2 additions and 6 deletions
|
|
@ -1860,14 +1860,10 @@ static int ks_wlan_set_preamble(struct net_device *dev,
|
|||
return -EPERM;
|
||||
|
||||
/* for SLEEP MODE */
|
||||
if (*uwrq == LONG_PREAMBLE) { /* 0 */
|
||||
priv->reg.preamble = LONG_PREAMBLE;
|
||||
} else if (*uwrq == SHORT_PREAMBLE) { /* 1 */
|
||||
priv->reg.preamble = SHORT_PREAMBLE;
|
||||
} else {
|
||||
if (*uwrq != LONG_PREAMBLE && *uwrq != SHORT_PREAMBLE)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
priv->reg.preamble = *uwrq;
|
||||
priv->need_commit |= SME_MODE_SET;
|
||||
return -EINPROGRESS; /* Call commit handler */
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue