summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks7010_sdio.c
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-04-27 11:25:19 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 11:47:26 +0200
commit0e24eb8abf93a2e80ecbe97419d2d1fe089a7386 (patch)
tree843ed6348df2a10d81ff508083f646e993ee9591 /drivers/staging/ks7010/ks7010_sdio.c
parent11ce16da7b0f5335c7622ccc7c8151a387b44853 (diff)
downloadop-kernel-dev-0e24eb8abf93a2e80ecbe97419d2d1fe089a7386.zip
op-kernel-dev-0e24eb8abf93a2e80ecbe97419d2d1fe089a7386.tar.gz
staging: ks7010: abstract connection status
Host interface connection status is handled using a 32 bit type. Top byte is used as for FORCE_DISCONNECT status, low bits are used for connect/disconnect status. Driver masks and checks integers to ascertain status. If functions are defined to do the masking and equality check then the details of how the status integer is used are abstracted away. This makes the code easier to read. Also future updates to the status handling will be easier because the code is in one place. Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as values, as apposed to opaque values. Because of this driver code checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as apposed to negating a single check (ie 'foo != CONNECT_STATUS). In order to maintain the current functionality we define two separate functions is_connect_status() and is_disconnect_status(). Add functions to abstract the status integer check. Update all sites that do the check manually to use the newly defined functions. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ks7010/ks7010_sdio.c')
-rw-r--r--drivers/staging/ks7010/ks7010_sdio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index ec11799..e36c1d0 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -172,7 +172,7 @@ static void _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
if (priv->reg.operation_mode != MODE_INFRASTRUCTURE)
return;
- if ((priv->connect_status & CONNECT_STATUS_MASK) != CONNECT_STATUS)
+ if (!is_connect_status(priv->connect_status))
return;
if (priv->dev_state != DEVICE_STATE_SLEEP)
OpenPOWER on IntegriCloud