staging: ks7010: create reg_status_type enum type
authorTobin C. Harding <me@tobin.cc>
Tue, 18 Apr 2017 00:35:29 +0000 (10:35 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Apr 2017 11:33:17 +0000 (13:33 +0200)
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 <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c
drivers/staging/ks7010/ks7010_sdio.h

index 59451f8881aac323f764b28fc66aa7a027467ab0..b103a20ad4908c4151724095ab16289874afa739 100644 (file)
@@ -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)
index c01a0207f2c147731a6cd0958d749aba00a41316..0b8b865a44c0183a925bcc4233e76a62874e2fdd 100644 (file)
 /* 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
 /* 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