Commit 63c31af3 authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: ks7010: add enum sleep_mode_type

Driver uses preprocessor directives to define SLP_ASLEEP and
SLP_ACTIVE. These can be defined using an enumeration type. Doing so
adds to the readability and gives the usual compiler benefits of
having an enum. Functions that currently accept integer types can now
use the new enumeration type, further aiding readability.

Add enumeration type sleep_mode_type. Update code that handles sleep
mode to use the new enumeration type.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e24eb8a
...@@ -1665,11 +1665,12 @@ void hostif_power_mngmt_request(struct ks_wlan_private *priv, ...@@ -1665,11 +1665,12 @@ void hostif_power_mngmt_request(struct ks_wlan_private *priv,
} }
static static
void hostif_sleep_request(struct ks_wlan_private *priv, unsigned long mode) void hostif_sleep_request(struct ks_wlan_private *priv,
enum sleep_mode_type mode)
{ {
struct hostif_sleep_request_t *pp; struct hostif_sleep_request_t *pp;
DPRINTK(3, "mode=%lu\n", mode); DPRINTK(3, "mode=%lu\n", (long)mode);
if (mode == SLP_SLEEP) { if (mode == SLP_SLEEP) {
pp = hostif_generic_request(sizeof(*pp), HIF_SLEEP_REQ); pp = hostif_generic_request(sizeof(*pp), HIF_SLEEP_REQ);
...@@ -1684,7 +1685,7 @@ void hostif_sleep_request(struct ks_wlan_private *priv, unsigned long mode) ...@@ -1684,7 +1685,7 @@ void hostif_sleep_request(struct ks_wlan_private *priv, unsigned long mode)
atomic_set(&priv->sleepstatus.wakeup_request, 1); atomic_set(&priv->sleepstatus.wakeup_request, 1);
queue_delayed_work(priv->wq, &priv->rw_dwork, 1); queue_delayed_work(priv->wq, &priv->rw_dwork, 1);
} else { } else {
DPRINTK(3, "invalid mode %ld\n", mode); DPRINTK(3, "invalid mode %ld\n", (long)mode);
return; return;
} }
} }
......
...@@ -542,9 +542,11 @@ struct hostif_phy_information_confirm_t { ...@@ -542,9 +542,11 @@ struct hostif_phy_information_confirm_t {
u32 rx_error; u32 rx_error;
} __packed; } __packed;
/* sleep mode */ enum sleep_mode_type {
#define SLP_ACTIVE 0 SLP_ACTIVE,
#define SLP_SLEEP 1 SLP_SLEEP
};
struct hostif_sleep_request_t { struct hostif_sleep_request_t {
struct hostif_hdr header; struct hostif_hdr header;
} __packed; } __packed;
......
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