From bfee6a231903b1f1f8d72cc638be6862d7099377 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 18 Apr 2017 10:35:29 +1000 Subject: [PATCH] staging: ks7010: create reg_status_type enum type SDIO header currently defines unused constants READ_STATUS_BUSY and WRITE_STATUS_IDLE. There are reciprocal constants that are used READ_STATUS_IDLE and WRITE_STATUS_BUSY. We can roll these into a single enumeration type and remove the two that are unused. Add enumeration type containing IDLE/BUSY pair that are currently used within the SDIO source. Change source to use new enum types. Signed-off-by: Tobin C. Harding Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks7010_sdio.c | 6 +++--- drivers/staging/ks7010/ks7010_sdio.h | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 59451f8881aa..b103a20ad490 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -295,7 +295,7 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer, return ret; } - rw_data = WRITE_STATUS_BUSY; + rw_data = REG_STATUS_BUSY; ret = ks7010_sdio_write(priv, WRITE_STATUS, &rw_data, sizeof(rw_data)); if (ret) { DPRINTK(1, " error : WRITE_STATUS=%02X\n", rw_data); @@ -415,7 +415,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size) rx_buffer->data, 32); #endif /* rx_status update */ - read_status = READ_STATUS_IDLE; + read_status = REG_STATUS_IDLE; ret = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status)); if (ret) @@ -431,7 +431,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size) inc_rxqtail(priv); /* read status update */ - read_status = READ_STATUS_IDLE; + read_status = REG_STATUS_IDLE; ret = ks7010_sdio_write(priv, READ_STATUS, &read_status, sizeof(read_status)); if (ret) diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h index c01a0207f2c1..0b8b865a44c0 100644 --- a/drivers/staging/ks7010/ks7010_sdio.h +++ b/drivers/staging/ks7010/ks7010_sdio.h @@ -22,10 +22,13 @@ /* Older sources suggest earlier versions were named 7910 or 79xx */ #define SDIO_DEVICE_ID_KS_7010 0x7910 -/* Read Status Register */ +/* Read/Write Status Register */ #define READ_STATUS 0x000000 -#define READ_STATUS_BUSY 0 -#define READ_STATUS_IDLE 1 +#define WRITE_STATUS 0x00000C +enum reg_status_type { + REG_STATUS_BUSY, + REG_STATUS_IDLE +}; /* Read Index Register */ #define READ_INDEX 0x000004 @@ -33,11 +36,6 @@ /* Read Data Size Register */ #define READ_DATA_SIZE 0x000008 -/* Write Status Register */ -#define WRITE_STATUS 0x00000C -#define WRITE_STATUS_BUSY 0 -#define WRITE_STATUS_IDLE 1 - /* Write Index Register */ #define WRITE_INDEX 0x000010 -- GitLab