aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ath6kl/bmi/src/bmi.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-02-02 17:05:56 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-02 17:34:51 -0500
commita1d46529630cbe1072b7b7b1a0104655b47cd7de (patch)
tree202f8beb893a2e35524d221b10e19f7489057e54 /drivers/staging/ath6kl/bmi/src/bmi.c
parentf68057e6fab6943ea2c5867d8b72e4b08bef5f6e (diff)
staging: ath6kl: Convert (status != A_OK) to (status)
Just use the status variable as a test not a comparison. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/ath6kl/bmi/src/bmi.c')
-rw-r--r--drivers/staging/ath6kl/bmi/src/bmi.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/staging/ath6kl/bmi/src/bmi.c b/drivers/staging/ath6kl/bmi/src/bmi.c
index 44add2d99f5..104c53e430b 100644
--- a/drivers/staging/ath6kl/bmi/src/bmi.c
+++ b/drivers/staging/ath6kl/bmi/src/bmi.c
@@ -121,7 +121,7 @@ BMIDone(HIF_DEVICE *device)
121 cid = BMI_DONE; 121 cid = BMI_DONE;
122 122
123 status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid)); 123 status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
124 if (status != A_OK) { 124 if (status) {
125 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 125 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
126 return A_ERROR; 126 return A_ERROR;
127 } 127 }
@@ -156,14 +156,14 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
156 cid = BMI_GET_TARGET_INFO; 156 cid = BMI_GET_TARGET_INFO;
157 157
158 status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid)); 158 status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
159 if (status != A_OK) { 159 if (status) {
160 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 160 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
161 return A_ERROR; 161 return A_ERROR;
162 } 162 }
163 163
164 status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver, 164 status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver,
165 sizeof(targ_info->target_ver), true); 165 sizeof(targ_info->target_ver), true);
166 if (status != A_OK) { 166 if (status) {
167 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n")); 167 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n"));
168 return A_ERROR; 168 return A_ERROR;
169 } 169 }
@@ -172,7 +172,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
172 /* Determine how many bytes are in the Target's targ_info */ 172 /* Determine how many bytes are in the Target's targ_info */
173 status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count, 173 status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count,
174 sizeof(targ_info->target_info_byte_count), true); 174 sizeof(targ_info->target_info_byte_count), true);
175 if (status != A_OK) { 175 if (status) {
176 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n")); 176 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n"));
177 return A_ERROR; 177 return A_ERROR;
178 } 178 }
@@ -187,7 +187,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
187 status = bmiBufferReceive(device, 187 status = bmiBufferReceive(device,
188 ((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count), 188 ((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count),
189 sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count), true); 189 sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count), true);
190 if (status != A_OK) { 190 if (status) {
191 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n", 191 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n",
192 targ_info->target_info_byte_count)); 192 targ_info->target_info_byte_count));
193 return A_ERROR; 193 return A_ERROR;
@@ -239,12 +239,12 @@ BMIReadMemory(HIF_DEVICE *device,
239 offset += sizeof(length); 239 offset += sizeof(length);
240 240
241 status = bmiBufferSend(device, pBMICmdBuf, offset); 241 status = bmiBufferSend(device, pBMICmdBuf, offset);
242 if (status != A_OK) { 242 if (status) {
243 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 243 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
244 return A_ERROR; 244 return A_ERROR;
245 } 245 }
246 status = bmiBufferReceive(device, pBMICmdBuf, rxlen, true); 246 status = bmiBufferReceive(device, pBMICmdBuf, rxlen, true);
247 if (status != A_OK) { 247 if (status) {
248 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); 248 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
249 return A_ERROR; 249 return A_ERROR;
250 } 250 }
@@ -309,7 +309,7 @@ BMIWriteMemory(HIF_DEVICE *device,
309 A_MEMCPY(&(pBMICmdBuf[offset]), src, txlen); 309 A_MEMCPY(&(pBMICmdBuf[offset]), src, txlen);
310 offset += txlen; 310 offset += txlen;
311 status = bmiBufferSend(device, pBMICmdBuf, offset); 311 status = bmiBufferSend(device, pBMICmdBuf, offset);
312 if (status != A_OK) { 312 if (status) {
313 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 313 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
314 return A_ERROR; 314 return A_ERROR;
315 } 315 }
@@ -352,13 +352,13 @@ BMIExecute(HIF_DEVICE *device,
352 A_MEMCPY(&(pBMICmdBuf[offset]), param, sizeof(*param)); 352 A_MEMCPY(&(pBMICmdBuf[offset]), param, sizeof(*param));
353 offset += sizeof(*param); 353 offset += sizeof(*param);
354 status = bmiBufferSend(device, pBMICmdBuf, offset); 354 status = bmiBufferSend(device, pBMICmdBuf, offset);
355 if (status != A_OK) { 355 if (status) {
356 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 356 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
357 return A_ERROR; 357 return A_ERROR;
358 } 358 }
359 359
360 status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), false); 360 status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), false);
361 if (status != A_OK) { 361 if (status) {
362 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); 362 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
363 return A_ERROR; 363 return A_ERROR;
364 } 364 }
@@ -397,7 +397,7 @@ BMISetAppStart(HIF_DEVICE *device,
397 A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); 397 A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address));
398 offset += sizeof(address); 398 offset += sizeof(address);
399 status = bmiBufferSend(device, pBMICmdBuf, offset); 399 status = bmiBufferSend(device, pBMICmdBuf, offset);
400 if (status != A_OK) { 400 if (status) {
401 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 401 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
402 return A_ERROR; 402 return A_ERROR;
403 } 403 }
@@ -436,13 +436,13 @@ BMIReadSOCRegister(HIF_DEVICE *device,
436 offset += sizeof(address); 436 offset += sizeof(address);
437 437
438 status = bmiBufferSend(device, pBMICmdBuf, offset); 438 status = bmiBufferSend(device, pBMICmdBuf, offset);
439 if (status != A_OK) { 439 if (status) {
440 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 440 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
441 return A_ERROR; 441 return A_ERROR;
442 } 442 }
443 443
444 status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), true); 444 status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), true);
445 if (status != A_OK) { 445 if (status) {
446 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); 446 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
447 return A_ERROR; 447 return A_ERROR;
448 } 448 }
@@ -483,7 +483,7 @@ BMIWriteSOCRegister(HIF_DEVICE *device,
483 A_MEMCPY(&(pBMICmdBuf[offset]), &param, sizeof(param)); 483 A_MEMCPY(&(pBMICmdBuf[offset]), &param, sizeof(param));
484 offset += sizeof(param); 484 offset += sizeof(param);
485 status = bmiBufferSend(device, pBMICmdBuf, offset); 485 status = bmiBufferSend(device, pBMICmdBuf, offset);
486 if (status != A_OK) { 486 if (status) {
487 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 487 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
488 return A_ERROR; 488 return A_ERROR;
489 } 489 }
@@ -532,13 +532,13 @@ BMIrompatchInstall(HIF_DEVICE *device,
532 A_MEMCPY(&(pBMICmdBuf[offset]), &do_activate, sizeof(do_activate)); 532 A_MEMCPY(&(pBMICmdBuf[offset]), &do_activate, sizeof(do_activate));
533 offset += sizeof(do_activate); 533 offset += sizeof(do_activate);
534 status = bmiBufferSend(device, pBMICmdBuf, offset); 534 status = bmiBufferSend(device, pBMICmdBuf, offset);
535 if (status != A_OK) { 535 if (status) {
536 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 536 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
537 return A_ERROR; 537 return A_ERROR;
538 } 538 }
539 539
540 status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*rompatch_id), true); 540 status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*rompatch_id), true);
541 if (status != A_OK) { 541 if (status) {
542 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); 542 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
543 return A_ERROR; 543 return A_ERROR;
544 } 544 }
@@ -576,7 +576,7 @@ BMIrompatchUninstall(HIF_DEVICE *device,
576 A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_id, sizeof(rompatch_id)); 576 A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_id, sizeof(rompatch_id));
577 offset += sizeof(rompatch_id); 577 offset += sizeof(rompatch_id);
578 status = bmiBufferSend(device, pBMICmdBuf, offset); 578 status = bmiBufferSend(device, pBMICmdBuf, offset);
579 if (status != A_OK) { 579 if (status) {
580 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 580 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
581 return A_ERROR; 581 return A_ERROR;
582 } 582 }
@@ -619,7 +619,7 @@ _BMIrompatchChangeActivation(HIF_DEVICE *device,
619 A_MEMCPY(&(pBMICmdBuf[offset]), rompatch_list, length); 619 A_MEMCPY(&(pBMICmdBuf[offset]), rompatch_list, length);
620 offset += length; 620 offset += length;
621 status = bmiBufferSend(device, pBMICmdBuf, offset); 621 status = bmiBufferSend(device, pBMICmdBuf, offset);
622 if (status != A_OK) { 622 if (status) {
623 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 623 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
624 return A_ERROR; 624 return A_ERROR;
625 } 625 }
@@ -683,7 +683,7 @@ BMILZData(HIF_DEVICE *device,
683 A_MEMCPY(&(pBMICmdBuf[offset]), &buffer[length - remaining], txlen); 683 A_MEMCPY(&(pBMICmdBuf[offset]), &buffer[length - remaining], txlen);
684 offset += txlen; 684 offset += txlen;
685 status = bmiBufferSend(device, pBMICmdBuf, offset); 685 status = bmiBufferSend(device, pBMICmdBuf, offset);
686 if (status != A_OK) { 686 if (status) {
687 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); 687 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
688 return A_ERROR; 688 return A_ERROR;
689 } 689 }
@@ -722,7 +722,7 @@ BMILZStreamStart(HIF_DEVICE *device,
722 A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); 722 A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address));
723 offset += sizeof(address); 723 offset += sizeof(address);
724 status = bmiBufferSend(device, pBMICmdBuf, offset); 724 status = bmiBufferSend(device, pBMICmdBuf, offset);
725 if (status != A_OK) { 725 if (status) {
726 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to Start LZ Stream to the device\n")); 726 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to Start LZ Stream to the device\n"));
727 return A_ERROR; 727 return A_ERROR;
728 } 728 }
@@ -757,7 +757,7 @@ bmiBufferSend(HIF_DEVICE *device,
757 * make all HIF accesses 4-byte aligned */ 757 * make all HIF accesses 4-byte aligned */
758 status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, 4, 758 status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, 4,
759 HIF_RD_SYNC_BYTE_INC, NULL); 759 HIF_RD_SYNC_BYTE_INC, NULL);
760 if (status != A_OK) { 760 if (status) {
761 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n")); 761 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n"));
762 return A_ERROR; 762 return A_ERROR;
763 } 763 }
@@ -769,7 +769,7 @@ bmiBufferSend(HIF_DEVICE *device,
769 address = mboxAddress[ENDPOINT1]; 769 address = mboxAddress[ENDPOINT1];
770 status = HIFReadWrite(device, address, buffer, length, 770 status = HIFReadWrite(device, address, buffer, length,
771 HIF_WR_SYNC_BYTE_INC, NULL); 771 HIF_WR_SYNC_BYTE_INC, NULL);
772 if (status != A_OK) { 772 if (status) {
773 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n")); 773 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n"));
774 return A_ERROR; 774 return A_ERROR;
775 } 775 }
@@ -868,7 +868,7 @@ bmiBufferReceive(HIF_DEVICE *device,
868 status = getPendingEventsFunc(device, 868 status = getPendingEventsFunc(device,
869 &hifPendingEvents, 869 &hifPendingEvents,
870 NULL); 870 NULL);
871 if (status != A_OK) { 871 if (status) {
872 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to get pending events \n")); 872 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to get pending events \n"));
873 break; 873 break;
874 } 874 }
@@ -881,7 +881,7 @@ bmiBufferReceive(HIF_DEVICE *device,
881 881
882 status = HIFReadWrite(device, RX_LOOKAHEAD_VALID_ADDRESS, (u8 *)&word_available, 882 status = HIFReadWrite(device, RX_LOOKAHEAD_VALID_ADDRESS, (u8 *)&word_available,
883 sizeof(word_available), HIF_RD_SYNC_BYTE_INC, NULL); 883 sizeof(word_available), HIF_RD_SYNC_BYTE_INC, NULL);
884 if (status != A_OK) { 884 if (status) {
885 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read RX_LOOKAHEAD_VALID register\n")); 885 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read RX_LOOKAHEAD_VALID register\n"));
886 return A_ERROR; 886 return A_ERROR;
887 } 887 }
@@ -932,7 +932,7 @@ bmiBufferReceive(HIF_DEVICE *device,
932 * The rationale here is to make all HIF accesses a multiple of 4 bytes */ 932 * The rationale here is to make all HIF accesses a multiple of 4 bytes */
933 status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, sizeof(*pBMICmdCredits), 933 status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, sizeof(*pBMICmdCredits),
934 HIF_RD_SYNC_BYTE_FIX, NULL); 934 HIF_RD_SYNC_BYTE_FIX, NULL);
935 if (status != A_OK) { 935 if (status) {
936 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n")); 936 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n"));
937 return A_ERROR; 937 return A_ERROR;
938 } 938 }
@@ -949,7 +949,7 @@ bmiBufferReceive(HIF_DEVICE *device,
949 949
950 address = mboxAddress[ENDPOINT1]; 950 address = mboxAddress[ENDPOINT1];
951 status = HIFReadWrite(device, address, buffer, length, HIF_RD_SYNC_BYTE_INC, NULL); 951 status = HIFReadWrite(device, address, buffer, length, HIF_RD_SYNC_BYTE_INC, NULL);
952 if (status != A_OK) { 952 if (status) {
953 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n")); 953 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n"));
954 return A_ERROR; 954 return A_ERROR;
955 } 955 }