[PATCH 01/15] staging: ks7010: create reg_status_type enum type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 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 59451f8..b103a20 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 c01a020..0b8b865 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
 
-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux