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

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

staging: ks7010: refactor code for hostif_sme_sleep_set function



This commit refactors code for hostif_sme_sleep_set function. This
function was using a switch-case block to handle only two states
where the action to do for them is the same. Just refactor a bit
to check for return condition at first and doing the common action
after in other case.

Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3bef56b
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -2043,19 +2043,13 @@ void hostif_sme_power_mgmt_set(struct ks_wlan_private *priv)
	hostif_power_mgmt_request(priv, mode, wake_up, receive_dtims);
}

static
void hostif_sme_sleep_set(struct ks_wlan_private *priv)
static void hostif_sme_sleep_set(struct ks_wlan_private *priv)
{
	switch (priv->sleep_mode) {
	case SLP_SLEEP:
		hostif_sleep_request(priv, priv->sleep_mode);
		break;
	case SLP_ACTIVE:
	if (priv->sleep_mode != SLP_SLEEP &&
	    priv->sleep_mode != SLP_ACTIVE)
		return;

	hostif_sleep_request(priv, priv->sleep_mode);
		break;
	default:
		break;
	}
}

static