Skip to contentSkip to conversation

staging: vt6655: remove typedef enum __device_init_type

PATCH New Malcolm Priestley 1 participant 2 messages Jul 28, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: vt6655: remove typedef enum __device_init_type

The value is either DEVICE_INIT_COLD or DEVICE_INIT_DXPL making no difference to code.

Remove typedef and remove if statement in device_init_registers pulling the code in.

---
 drivers/staging/vt6655/device.h      |   6 -
 drivers/staging/vt6655/device_main.c | 412 +++++++++++++++++++----------------
 2 files changed, 225 insertions(+), 193 deletions(-)
drivers/staging/vt6655/device.h +0 -6
index b36c631..9bf0ea9 100644
@@ -185,12 +185,6 @@ typedef enum __device_msg_level {
 	MSG_LEVEL_DEBUG = 4           //Only for debug purpose.
 } DEVICE_MSG_LEVEL, *PDEVICE_MSG_LEVEL;
 
-typedef enum __device_init_type {
-	DEVICE_INIT_COLD = 0,         // cold init
-	DEVICE_INIT_RESET,          // reset init or Dx to D0 power remain init
-	DEVICE_INIT_DXPL            // Dx to D0 power lost init
-} DEVICE_INIT_TYPE, *PDEVICE_INIT_TYPE;
-
 //++ NDIS related
 
 #define MAX_BSSIDINFO_4_PMKID   16
drivers/staging/vt6655/device_main.c +225 -187

492 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 staging: vt6655: clean up the tail of function device_init_registers

Aligning the code.

---
 drivers/staging/vt6655/device_main.c | 37 ++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)
drivers/staging/vt6655/device_main.c +19 -18
index 0ecc99b..3f72c34 100644
@@ -736,30 +736,31 @@ static void device_init_registers(PSDevice pDevice)
 	if (pDevice->bHWRadioOff || pDevice->bRadioControlOff)
 		CARDbRadioPowerOff(pDevice);
 
-pMgmt->eScanType = WMAC_SCAN_PASSIVE;
-// get Permanent network address
-SROMvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
-DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Network address = %pM\n",
-	pDevice->abyCurrentNetAddr);
+	pMgmt->eScanType = WMAC_SCAN_PASSIVE;
 
-// reset Tx pointer
-CARDvSafeResetRx(pDevice);
-// reset Rx pointer
-CARDvSafeResetTx(pDevice);
+	/* get Permanent network address */
+	SROMvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
+	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Network address = %pM\n",
+		pDevice->abyCurrentNetAddr);
 
-if (pDevice->byLocalID <= REV_ID_VT3253_A1)
-	MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_WPAERR);
+	/* reset Tx pointer */
+	CARDvSafeResetRx(pDevice);
+	/* reset Rx pointer */
+	CARDvSafeResetTx(pDevice);
 
-pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
+	if (pDevice->byLocalID <= REV_ID_VT3253_A1)
+		MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_WPAERR);
 
-// Turn On Rx DMA
-MACvReceive0(pDevice->PortOffset);
-MACvReceive1(pDevice->PortOffset);
+	pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
 
-// start the adapter
-MACvStart(pDevice->PortOffset);
+	/* Turn On Rx DMA */
+	MACvReceive0(pDevice->PortOffset);
+	MACvReceive1(pDevice->PortOffset);
 
-netif_stop_queue(pDevice->dev);
+	/* start the adapter */
+	MACvStart(pDevice->PortOffset);
+
+	netif_stop_queue(pDevice->dev);
 }
 
 static void device_init_diversity_timer(PSDevice pDevice)
Signature · 1 line
1.9.1