diff options
| author | Harsh Kumar <harsh1kumar@gmail.com> | 2012-09-26 14:04:42 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-26 17:02:54 -0400 |
| commit | 814164462a07bf1c8011de8d8c8878cfa2920ad1 (patch) | |
| tree | d8c79c6326f6d46a177ff4b18f7583a36a23b2e0 | |
| parent | 907af425a92a3e7cfac597ca324934f514b04d85 (diff) | |
Staging: winbond: Removed undesired spaces, lines and tabs
checkpatch cleanup: Removed some undesired spaces, lines and tabs to comply with coding style.
Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/winbond/wb35tx.c | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c index 9a826957fe51..7a2024d6468e 100644 --- a/drivers/staging/winbond/wb35tx.c +++ b/drivers/staging/winbond/wb35tx.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "mds_f.h" | 15 | #include "mds_f.h" |
| 16 | 16 | ||
| 17 | unsigned char | 17 | unsigned char |
| 18 | Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer) | 18 | Wb35Tx_get_tx_buffer(struct hw_data *pHwData, u8 **pBuffer) |
| 19 | { | 19 | { |
| 20 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 20 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 21 | 21 | ||
| @@ -25,10 +25,10 @@ Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer) | |||
| 25 | 25 | ||
| 26 | static void Wb35Tx(struct wbsoft_priv *adapter); | 26 | static void Wb35Tx(struct wbsoft_priv *adapter); |
| 27 | 27 | ||
| 28 | static void Wb35Tx_complete(struct urb * pUrb) | 28 | static void Wb35Tx_complete(struct urb *pUrb) |
| 29 | { | 29 | { |
| 30 | struct wbsoft_priv *adapter = pUrb->context; | 30 | struct wbsoft_priv *adapter = pUrb->context; |
| 31 | struct hw_data * pHwData = &adapter->sHwData; | 31 | struct hw_data *pHwData = &adapter->sHwData; |
| 32 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 32 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 33 | struct wb35_mds *pMds = &adapter->Mds; | 33 | struct wb35_mds *pMds = &adapter->Mds; |
| 34 | 34 | ||
| @@ -37,7 +37,7 @@ static void Wb35Tx_complete(struct urb * pUrb) | |||
| 37 | pWb35Tx->EP4vm_state = VM_COMPLETED; | 37 | pWb35Tx->EP4vm_state = VM_COMPLETED; |
| 38 | pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */ | 38 | pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */ |
| 39 | /* Set the owner. Free the owner bit always. */ | 39 | /* Set the owner. Free the owner bit always. */ |
| 40 | pMds->TxOwner[ pWb35Tx->TxSendIndex ] = 0; | 40 | pMds->TxOwner[pWb35Tx->TxSendIndex] = 0; |
| 41 | pWb35Tx->TxSendIndex++; | 41 | pWb35Tx->TxSendIndex++; |
| 42 | pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER; | 42 | pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER; |
| 43 | 43 | ||
| @@ -65,15 +65,14 @@ error: | |||
| 65 | 65 | ||
| 66 | static void Wb35Tx(struct wbsoft_priv *adapter) | 66 | static void Wb35Tx(struct wbsoft_priv *adapter) |
| 67 | { | 67 | { |
| 68 | struct hw_data * pHwData = &adapter->sHwData; | 68 | struct hw_data *pHwData = &adapter->sHwData; |
| 69 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 69 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 70 | u8 *pTxBufferAddress; | 70 | u8 *pTxBufferAddress; |
| 71 | struct wb35_mds *pMds = &adapter->Mds; | 71 | struct wb35_mds *pMds = &adapter->Mds; |
| 72 | struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb; | 72 | struct urb *pUrb = (struct urb *)pWb35Tx->Tx4Urb; |
| 73 | int retv; | 73 | int retv; |
| 74 | u32 SendIndex; | 74 | u32 SendIndex; |
| 75 | 75 | ||
| 76 | |||
| 77 | if (pHwData->SurpriseRemove) | 76 | if (pHwData->SurpriseRemove) |
| 78 | goto cleanup; | 77 | goto cleanup; |
| 79 | 78 | ||
| @@ -91,12 +90,12 @@ static void Wb35Tx(struct wbsoft_priv *adapter) | |||
| 91 | /* Issuing URB */ | 90 | /* Issuing URB */ |
| 92 | usb_fill_bulk_urb(pUrb, pHwData->udev, | 91 | usb_fill_bulk_urb(pUrb, pHwData->udev, |
| 93 | usb_sndbulkpipe(pHwData->udev, 4), | 92 | usb_sndbulkpipe(pHwData->udev, 4), |
| 94 | pTxBufferAddress, pMds->TxBufferSize[ SendIndex ], | 93 | pTxBufferAddress, pMds->TxBufferSize[SendIndex], |
| 95 | Wb35Tx_complete, adapter); | 94 | Wb35Tx_complete, adapter); |
| 96 | 95 | ||
| 97 | pWb35Tx->EP4vm_state = VM_RUNNING; | 96 | pWb35Tx->EP4vm_state = VM_RUNNING; |
| 98 | retv = usb_submit_urb(pUrb, GFP_ATOMIC); | 97 | retv = usb_submit_urb(pUrb, GFP_ATOMIC); |
| 99 | if (retv<0) { | 98 | if (retv < 0) { |
| 100 | printk("EP4 Tx Irp sending error\n"); | 99 | printk("EP4 Tx Irp sending error\n"); |
| 101 | goto cleanup; | 100 | goto cleanup; |
| 102 | } | 101 | } |
| @@ -116,7 +115,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter) | |||
| 116 | 115 | ||
| 117 | void Wb35Tx_start(struct wbsoft_priv *adapter) | 116 | void Wb35Tx_start(struct wbsoft_priv *adapter) |
| 118 | { | 117 | { |
| 119 | struct hw_data * pHwData = &adapter->sHwData; | 118 | struct hw_data *pHwData = &adapter->sHwData; |
| 120 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 119 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 121 | 120 | ||
| 122 | /* Allow only one thread to run into function */ | 121 | /* Allow only one thread to run into function */ |
| @@ -127,7 +126,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter) | |||
| 127 | atomic_dec(&pWb35Tx->TxFireCounter); | 126 | atomic_dec(&pWb35Tx->TxFireCounter); |
| 128 | } | 127 | } |
| 129 | 128 | ||
| 130 | unsigned char Wb35Tx_initial(struct hw_data * pHwData) | 129 | unsigned char Wb35Tx_initial(struct hw_data *pHwData) |
| 131 | { | 130 | { |
| 132 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 131 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 133 | 132 | ||
| @@ -138,52 +137,52 @@ unsigned char Wb35Tx_initial(struct hw_data * pHwData) | |||
| 138 | pWb35Tx->Tx2Urb = usb_alloc_urb(0, GFP_ATOMIC); | 137 | pWb35Tx->Tx2Urb = usb_alloc_urb(0, GFP_ATOMIC); |
| 139 | if (!pWb35Tx->Tx2Urb) | 138 | if (!pWb35Tx->Tx2Urb) |
| 140 | { | 139 | { |
| 141 | usb_free_urb( pWb35Tx->Tx4Urb ); | 140 | usb_free_urb(pWb35Tx->Tx4Urb); |
| 142 | return false; | 141 | return false; |
| 143 | } | 142 | } |
| 144 | 143 | ||
| 145 | return true; | 144 | return true; |
| 146 | } | 145 | } |
| 147 | 146 | ||
| 148 | void Wb35Tx_stop(struct hw_data * pHwData) | 147 | void Wb35Tx_stop(struct hw_data *pHwData) |
| 149 | { | 148 | { |
| 150 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 149 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 151 | 150 | ||
| 152 | /* Try to cancel the Trp of EP2 */ | 151 | /* Try to cancel the Trp of EP2 */ |
| 153 | if (pWb35Tx->EP2vm_state == VM_RUNNING) | 152 | if (pWb35Tx->EP2vm_state == VM_RUNNING) |
| 154 | /* Only use unlink, let Wb35Tx_destroy free them */ | 153 | /* Only use unlink, let Wb35Tx_destroy free them */ |
| 155 | usb_unlink_urb( pWb35Tx->Tx2Urb ); | 154 | usb_unlink_urb(pWb35Tx->Tx2Urb); |
| 156 | pr_debug("EP2 Tx stop\n"); | 155 | pr_debug("EP2 Tx stop\n"); |
| 157 | 156 | ||
| 158 | /* Try to cancel the Irp of EP4 */ | 157 | /* Try to cancel the Irp of EP4 */ |
| 159 | if (pWb35Tx->EP4vm_state == VM_RUNNING) | 158 | if (pWb35Tx->EP4vm_state == VM_RUNNING) |
| 160 | /* Only use unlink, let Wb35Tx_destroy free them */ | 159 | /* Only use unlink, let Wb35Tx_destroy free them */ |
| 161 | usb_unlink_urb( pWb35Tx->Tx4Urb ); | 160 | usb_unlink_urb(pWb35Tx->Tx4Urb); |
| 162 | pr_debug("EP4 Tx stop\n"); | 161 | pr_debug("EP4 Tx stop\n"); |
| 163 | } | 162 | } |
| 164 | 163 | ||
| 165 | void Wb35Tx_destroy(struct hw_data * pHwData) | 164 | void Wb35Tx_destroy(struct hw_data *pHwData) |
| 166 | { | 165 | { |
| 167 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 166 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 168 | 167 | ||
| 169 | /* Wait for VM stop */ | 168 | /* Wait for VM stop */ |
| 170 | do { | 169 | do { |
| 171 | msleep(10); /* Delay for waiting function enter 940623.1.a */ | 170 | msleep(10); /* Delay for waiting function enter 940623.1.a */ |
| 172 | } while( (pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP) ); | 171 | } while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP)); |
| 173 | msleep(10); /* Delay for waiting function enter 940623.1.b */ | 172 | msleep(10); /* Delay for waiting function enter 940623.1.b */ |
| 174 | 173 | ||
| 175 | if (pWb35Tx->Tx4Urb) | 174 | if (pWb35Tx->Tx4Urb) |
| 176 | usb_free_urb( pWb35Tx->Tx4Urb ); | 175 | usb_free_urb(pWb35Tx->Tx4Urb); |
| 177 | 176 | ||
| 178 | if (pWb35Tx->Tx2Urb) | 177 | if (pWb35Tx->Tx2Urb) |
| 179 | usb_free_urb( pWb35Tx->Tx2Urb ); | 178 | usb_free_urb(pWb35Tx->Tx2Urb); |
| 180 | 179 | ||
| 181 | pr_debug("Wb35Tx_destroy OK\n"); | 180 | pr_debug("Wb35Tx_destroy OK\n"); |
| 182 | } | 181 | } |
| 183 | 182 | ||
| 184 | void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount) | 183 | void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount) |
| 185 | { | 184 | { |
| 186 | struct hw_data * pHwData = &adapter->sHwData; | 185 | struct hw_data *pHwData = &adapter->sHwData; |
| 187 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 186 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 188 | unsigned char Trigger = false; | 187 | unsigned char Trigger = false; |
| 189 | 188 | ||
| @@ -200,17 +199,16 @@ void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount) | |||
| 200 | 199 | ||
| 201 | static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter); | 200 | static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter); |
| 202 | 201 | ||
| 203 | static void Wb35Tx_EP2VM_complete(struct urb * pUrb) | 202 | static void Wb35Tx_EP2VM_complete(struct urb *pUrb) |
| 204 | { | 203 | { |
| 205 | struct wbsoft_priv *adapter = pUrb->context; | 204 | struct wbsoft_priv *adapter = pUrb->context; |
| 206 | struct hw_data * pHwData = &adapter->sHwData; | 205 | struct hw_data *pHwData = &adapter->sHwData; |
| 207 | struct T02_descriptor T02, TSTATUS; | 206 | struct T02_descriptor T02, TSTATUS; |
| 208 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 207 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 209 | u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; | 208 | u32 *pltmp = (u32 *)pWb35Tx->EP2_buf; |
| 210 | u32 i; | 209 | u32 i; |
| 211 | u16 InterruptInLength; | 210 | u16 InterruptInLength; |
| 212 | 211 | ||
| 213 | |||
| 214 | /* Variable setting */ | 212 | /* Variable setting */ |
| 215 | pWb35Tx->EP2vm_state = VM_COMPLETED; | 213 | pWb35Tx->EP2vm_state = VM_COMPLETED; |
| 216 | pWb35Tx->EP2VM_status = pUrb->status; | 214 | pWb35Tx->EP2VM_status = pUrb->status; |
| @@ -225,7 +223,7 @@ static void Wb35Tx_EP2VM_complete(struct urb * pUrb) | |||
| 225 | /* The Urb is completed, check the result */ | 223 | /* The Urb is completed, check the result */ |
| 226 | if (pWb35Tx->EP2VM_status != 0) { | 224 | if (pWb35Tx->EP2VM_status != 0) { |
| 227 | printk("EP2 IoCompleteRoutine return error\n"); | 225 | printk("EP2 IoCompleteRoutine return error\n"); |
| 228 | pWb35Tx->EP2vm_state= VM_STOP; | 226 | pWb35Tx->EP2vm_state = VM_STOP; |
| 229 | goto error; | 227 | goto error; |
| 230 | } | 228 | } |
| 231 | 229 | ||
| @@ -239,7 +237,7 @@ static void Wb35Tx_EP2VM_complete(struct urb * pUrb) | |||
| 239 | T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24); | 237 | T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24); |
| 240 | 238 | ||
| 241 | TSTATUS.value = T02.value; /* 20061009 anson's endian */ | 239 | TSTATUS.value = T02.value; /* 20061009 anson's endian */ |
| 242 | Mds_SendComplete( adapter, &TSTATUS ); | 240 | Mds_SendComplete(adapter, &TSTATUS); |
| 243 | T02.value = cpu_to_le32(pltmp[i]) >> 8; | 241 | T02.value = cpu_to_le32(pltmp[i]) >> 8; |
| 244 | } | 242 | } |
| 245 | 243 | ||
| @@ -251,10 +249,10 @@ error: | |||
| 251 | 249 | ||
| 252 | static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter) | 250 | static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter) |
| 253 | { | 251 | { |
| 254 | struct hw_data * pHwData = &adapter->sHwData; | 252 | struct hw_data *pHwData = &adapter->sHwData; |
| 255 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 253 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 256 | struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb; | 254 | struct urb *pUrb = (struct urb *)pWb35Tx->Tx2Urb; |
| 257 | u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; | 255 | u32 *pltmp = (u32 *)pWb35Tx->EP2_buf; |
| 258 | int retv; | 256 | int retv; |
| 259 | 257 | ||
| 260 | if (pHwData->SurpriseRemove) | 258 | if (pHwData->SurpriseRemove) |
| @@ -264,7 +262,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter) | |||
| 264 | goto error; | 262 | goto error; |
| 265 | 263 | ||
| 266 | /* Issuing URB */ | 264 | /* Issuing URB */ |
| 267 | usb_fill_int_urb( pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev,2), | 265 | usb_fill_int_urb(pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev, 2), |
| 268 | pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32); | 266 | pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32); |
| 269 | 267 | ||
| 270 | pWb35Tx->EP2vm_state = VM_RUNNING; | 268 | pWb35Tx->EP2vm_state = VM_RUNNING; |
| @@ -283,7 +281,7 @@ error: | |||
| 283 | 281 | ||
| 284 | void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter) | 282 | void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter) |
| 285 | { | 283 | { |
| 286 | struct hw_data * pHwData = &adapter->sHwData; | 284 | struct hw_data *pHwData = &adapter->sHwData; |
| 287 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; | 285 | struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; |
| 288 | 286 | ||
| 289 | /* Allow only one thread to run into function */ | 287 | /* Allow only one thread to run into function */ |
