diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-07-19 14:46:48 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:52:30 -0400 |
commit | b2a4a43dbaf10383703d512bbe560d5a24da0bf2 (patch) | |
tree | def1e43e1d67d9a2a515c77eacdd94e6b209ef67 /drivers/block/cciss_scsi.c | |
parent | 6b4d96b878d67c6768766e682c188a2a8bdc804a (diff) |
cciss: change printks to dev_warn, etc.
cciss: change printks to dev_warn, etc.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss_scsi.c')
-rw-r--r-- | drivers/block/cciss_scsi.c | 159 |
1 files changed, 74 insertions, 85 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 9fe0d8ffc90d..575495f3c4b8 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -192,7 +192,8 @@ scsi_cmd_free(ctlr_info_t *h, CommandList_struct *c) | |||
192 | stk = &sa->cmd_stack; | 192 | stk = &sa->cmd_stack; |
193 | stk->top++; | 193 | stk->top++; |
194 | if (stk->top >= CMD_STACK_SIZE) { | 194 | if (stk->top >= CMD_STACK_SIZE) { |
195 | printk("cciss: scsi_cmd_free called too many times.\n"); | 195 | dev_err(&h->pdev->dev, |
196 | "scsi_cmd_free called too many times.\n"); | ||
196 | BUG(); | 197 | BUG(); |
197 | } | 198 | } |
198 | stk->elem[stk->top] = (struct cciss_scsi_cmd_stack_elem_t *) c; | 199 | stk->elem[stk->top] = (struct cciss_scsi_cmd_stack_elem_t *) c; |
@@ -245,10 +246,9 @@ scsi_cmd_stack_free(ctlr_info_t *h) | |||
245 | sa = h->scsi_ctlr; | 246 | sa = h->scsi_ctlr; |
246 | stk = &sa->cmd_stack; | 247 | stk = &sa->cmd_stack; |
247 | if (stk->top != CMD_STACK_SIZE-1) { | 248 | if (stk->top != CMD_STACK_SIZE-1) { |
248 | printk( "cciss: %d scsi commands are still outstanding.\n", | 249 | dev_warn(&h->pdev->dev, |
250 | "bug: %d scsi commands are still outstanding.\n", | ||
249 | CMD_STACK_SIZE - stk->top); | 251 | CMD_STACK_SIZE - stk->top); |
250 | // BUG(); | ||
251 | printk("WE HAVE A BUG HERE!!! stk=0x%p\n", stk); | ||
252 | } | 252 | } |
253 | size = sizeof(struct cciss_scsi_cmd_stack_elem_t) * CMD_STACK_SIZE; | 253 | size = sizeof(struct cciss_scsi_cmd_stack_elem_t) * CMD_STACK_SIZE; |
254 | 254 | ||
@@ -382,8 +382,8 @@ cciss_scsi_add_entry(ctlr_info_t *h, int hostno, | |||
382 | unsigned char addr1[8], addr2[8]; | 382 | unsigned char addr1[8], addr2[8]; |
383 | 383 | ||
384 | if (n >= CCISS_MAX_SCSI_DEVS_PER_HBA) { | 384 | if (n >= CCISS_MAX_SCSI_DEVS_PER_HBA) { |
385 | printk("cciss%d: Too many devices, " | 385 | dev_warn(&h->pdev->dev, "Too many devices, " |
386 | "some will be inaccessible.\n", h->ctlr); | 386 | "some will be inaccessible.\n"); |
387 | return -1; | 387 | return -1; |
388 | } | 388 | } |
389 | 389 | ||
@@ -439,8 +439,8 @@ cciss_scsi_add_entry(ctlr_info_t *h, int hostno, | |||
439 | know our hostno and we don't want to print anything first | 439 | know our hostno and we don't want to print anything first |
440 | time anyway (the scsi layer's inquiries will show that info) */ | 440 | time anyway (the scsi layer's inquiries will show that info) */ |
441 | if (hostno != -1) | 441 | if (hostno != -1) |
442 | printk("cciss%d: %s device c%db%dt%dl%d added.\n", | 442 | dev_info(&h->pdev->dev, "%s device c%db%dt%dl%d added.\n", |
443 | h->ctlr, scsi_device_type(sd->devtype), hostno, | 443 | scsi_device_type(sd->devtype), hostno, |
444 | sd->bus, sd->target, sd->lun); | 444 | sd->bus, sd->target, sd->lun); |
445 | return 0; | 445 | return 0; |
446 | } | 446 | } |
@@ -462,8 +462,8 @@ cciss_scsi_remove_entry(ctlr_info_t *h, int hostno, int entry, | |||
462 | for (i = entry; i < ccissscsi[h->ctlr].ndevices-1; i++) | 462 | for (i = entry; i < ccissscsi[h->ctlr].ndevices-1; i++) |
463 | ccissscsi[h->ctlr].dev[i] = ccissscsi[h->ctlr].dev[i+1]; | 463 | ccissscsi[h->ctlr].dev[i] = ccissscsi[h->ctlr].dev[i+1]; |
464 | ccissscsi[h->ctlr].ndevices--; | 464 | ccissscsi[h->ctlr].ndevices--; |
465 | printk("cciss%d: %s device c%db%dt%dl%d removed.\n", | 465 | dev_info(&h->pdev->dev, "%s device c%db%dt%dl%d removed.\n", |
466 | h->ctlr, scsi_device_type(sd.devtype), hostno, | 466 | scsi_device_type(sd.devtype), hostno, |
467 | sd.bus, sd.target, sd.lun); | 467 | sd.bus, sd.target, sd.lun); |
468 | } | 468 | } |
469 | 469 | ||
@@ -536,8 +536,8 @@ adjust_cciss_scsi_table(ctlr_info_t *h, int hostno, | |||
536 | GFP_KERNEL); | 536 | GFP_KERNEL); |
537 | 537 | ||
538 | if (!added || !removed) { | 538 | if (!added || !removed) { |
539 | printk(KERN_WARNING "cciss%d: Out of memory in " | 539 | dev_warn(&h->pdev->dev, |
540 | "adjust_cciss_scsi_table\n", h->ctlr); | 540 | "Out of memory in adjust_cciss_scsi_table\n"); |
541 | goto free_and_out; | 541 | goto free_and_out; |
542 | } | 542 | } |
543 | 543 | ||
@@ -568,17 +568,14 @@ adjust_cciss_scsi_table(ctlr_info_t *h, int hostno, | |||
568 | 568 | ||
569 | if (found == 0) { /* device no longer present. */ | 569 | if (found == 0) { /* device no longer present. */ |
570 | changes++; | 570 | changes++; |
571 | /* printk("cciss%d: %s device c%db%dt%dl%d removed.\n", | ||
572 | h->ctlr, scsi_device_type(csd->devtype), hostno, | ||
573 | csd->bus, csd->target, csd->lun); */ | ||
574 | cciss_scsi_remove_entry(h, hostno, i, | 571 | cciss_scsi_remove_entry(h, hostno, i, |
575 | removed, &nremoved); | 572 | removed, &nremoved); |
576 | /* remove ^^^, hence i not incremented */ | 573 | /* remove ^^^, hence i not incremented */ |
577 | } else if (found == 1) { /* device is different in some way */ | 574 | } else if (found == 1) { /* device is different in some way */ |
578 | changes++; | 575 | changes++; |
579 | printk("cciss%d: device c%db%dt%dl%d has changed.\n", | 576 | dev_info(&h->pdev->dev, |
580 | h->ctlr, hostno, | 577 | "device c%db%dt%dl%d has changed.\n", |
581 | csd->bus, csd->target, csd->lun); | 578 | hostno, csd->bus, csd->target, csd->lun); |
582 | cciss_scsi_remove_entry(h, hostno, i, | 579 | cciss_scsi_remove_entry(h, hostno, i, |
583 | removed, &nremoved); | 580 | removed, &nremoved); |
584 | /* remove ^^^, hence i not incremented */ | 581 | /* remove ^^^, hence i not incremented */ |
@@ -623,8 +620,8 @@ adjust_cciss_scsi_table(ctlr_info_t *h, int hostno, | |||
623 | } else if (found == 1) { | 620 | } else if (found == 1) { |
624 | /* should never happen... */ | 621 | /* should never happen... */ |
625 | changes++; | 622 | changes++; |
626 | printk(KERN_WARNING "cciss%d: device " | 623 | dev_warn(&h->pdev->dev, |
627 | "unexpectedly changed\n", h->ctlr); | 624 | "device unexpectedly changed\n"); |
628 | /* but if it does happen, we just ignore that device */ | 625 | /* but if it does happen, we just ignore that device */ |
629 | } | 626 | } |
630 | } | 627 | } |
@@ -648,9 +645,9 @@ adjust_cciss_scsi_table(ctlr_info_t *h, int hostno, | |||
648 | /* We don't expect to get here. */ | 645 | /* We don't expect to get here. */ |
649 | /* future cmds to this device will get selection */ | 646 | /* future cmds to this device will get selection */ |
650 | /* timeout as if the device was gone. */ | 647 | /* timeout as if the device was gone. */ |
651 | printk(KERN_WARNING "cciss%d: didn't find " | 648 | dev_warn(&h->pdev->dev, "didn't find " |
652 | "c%db%dt%dl%d\n for removal.", | 649 | "c%db%dt%dl%d\n for removal.", |
653 | h->ctlr, hostno, removed[i].bus, | 650 | hostno, removed[i].bus, |
654 | removed[i].target, removed[i].lun); | 651 | removed[i].target, removed[i].lun); |
655 | } | 652 | } |
656 | } | 653 | } |
@@ -662,10 +659,9 @@ adjust_cciss_scsi_table(ctlr_info_t *h, int hostno, | |||
662 | added[i].target, added[i].lun); | 659 | added[i].target, added[i].lun); |
663 | if (rc == 0) | 660 | if (rc == 0) |
664 | continue; | 661 | continue; |
665 | printk(KERN_WARNING "cciss%d: scsi_add_device " | 662 | dev_warn(&h->pdev->dev, "scsi_add_device " |
666 | "c%db%dt%dl%d failed, device not added.\n", | 663 | "c%db%dt%dl%d failed, device not added.\n", |
667 | h->ctlr, hostno, | 664 | hostno, added[i].bus, added[i].target, added[i].lun); |
668 | added[i].bus, added[i].target, added[i].lun); | ||
669 | /* now we have to remove it from ccissscsi, */ | 665 | /* now we have to remove it from ccissscsi, */ |
670 | /* since it didn't get added to scsi mid layer */ | 666 | /* since it didn't get added to scsi mid layer */ |
671 | fixup_botched_add(h, added[i].scsi3addr); | 667 | fixup_botched_add(h, added[i].scsi3addr); |
@@ -788,7 +784,7 @@ static void complete_scsi_command(CommandList_struct *c, int timeout, | |||
788 | case CMD_DATA_UNDERRUN: /* let mid layer handle it. */ | 784 | case CMD_DATA_UNDERRUN: /* let mid layer handle it. */ |
789 | break; | 785 | break; |
790 | case CMD_DATA_OVERRUN: | 786 | case CMD_DATA_OVERRUN: |
791 | printk(KERN_WARNING "cciss: %p has" | 787 | dev_warn(&h->pdev->dev, "%p has" |
792 | " completed with data overrun " | 788 | " completed with data overrun " |
793 | "reported\n", c); | 789 | "reported\n", c); |
794 | break; | 790 | break; |
@@ -804,43 +800,41 @@ static void complete_scsi_command(CommandList_struct *c, int timeout, | |||
804 | } | 800 | } |
805 | break; | 801 | break; |
806 | case CMD_PROTOCOL_ERR: | 802 | case CMD_PROTOCOL_ERR: |
807 | printk(KERN_WARNING "cciss: %p has " | 803 | dev_warn(&h->pdev->dev, |
808 | "protocol error\n", c); | 804 | "%p has protocol error\n", c); |
809 | break; | 805 | break; |
810 | case CMD_HARDWARE_ERR: | 806 | case CMD_HARDWARE_ERR: |
811 | cmd->result = DID_ERROR << 16; | 807 | cmd->result = DID_ERROR << 16; |
812 | printk(KERN_WARNING "cciss: %p had " | 808 | dev_warn(&h->pdev->dev, |
813 | " hardware error\n", c); | 809 | "%p had hardware error\n", c); |
814 | break; | 810 | break; |
815 | case CMD_CONNECTION_LOST: | 811 | case CMD_CONNECTION_LOST: |
816 | cmd->result = DID_ERROR << 16; | 812 | cmd->result = DID_ERROR << 16; |
817 | printk(KERN_WARNING "cciss: %p had " | 813 | dev_warn(&h->pdev->dev, |
818 | "connection lost\n", c); | 814 | "%p had connection lost\n", c); |
819 | break; | 815 | break; |
820 | case CMD_ABORTED: | 816 | case CMD_ABORTED: |
821 | cmd->result = DID_ABORT << 16; | 817 | cmd->result = DID_ABORT << 16; |
822 | printk(KERN_WARNING "cciss: %p was " | 818 | dev_warn(&h->pdev->dev, "%p was aborted\n", c); |
823 | "aborted\n", c); | ||
824 | break; | 819 | break; |
825 | case CMD_ABORT_FAILED: | 820 | case CMD_ABORT_FAILED: |
826 | cmd->result = DID_ERROR << 16; | 821 | cmd->result = DID_ERROR << 16; |
827 | printk(KERN_WARNING "cciss: %p reports " | 822 | dev_warn(&h->pdev->dev, |
828 | "abort failed\n", c); | 823 | "%p reports abort failed\n", c); |
829 | break; | 824 | break; |
830 | case CMD_UNSOLICITED_ABORT: | 825 | case CMD_UNSOLICITED_ABORT: |
831 | cmd->result = DID_ABORT << 16; | 826 | cmd->result = DID_ABORT << 16; |
832 | printk(KERN_WARNING "cciss: %p aborted " | 827 | dev_warn(&h->pdev->dev, "%p aborted do to an " |
833 | "do to an unsolicited abort\n", c); | 828 | "unsolicited abort\n", c); |
834 | break; | 829 | break; |
835 | case CMD_TIMEOUT: | 830 | case CMD_TIMEOUT: |
836 | cmd->result = DID_TIME_OUT << 16; | 831 | cmd->result = DID_TIME_OUT << 16; |
837 | printk(KERN_WARNING "cciss: %p timedout\n", | 832 | dev_warn(&h->pdev->dev, "%p timedout\n", c); |
838 | c); | ||
839 | break; | 833 | break; |
840 | default: | 834 | default: |
841 | cmd->result = DID_ERROR << 16; | 835 | cmd->result = DID_ERROR << 16; |
842 | printk(KERN_WARNING "cciss: %p returned " | 836 | dev_warn(&h->pdev->dev, |
843 | "unknown status %x\n", c, | 837 | "%p returned unknown status %x\n", c, |
844 | ei->CommandStatus); | 838 | ei->CommandStatus); |
845 | } | 839 | } |
846 | } | 840 | } |
@@ -956,7 +950,7 @@ cciss_scsi_do_simple_cmd(ctlr_info_t *h, | |||
956 | } | 950 | } |
957 | 951 | ||
958 | static void | 952 | static void |
959 | cciss_scsi_interpret_error(CommandList_struct *c) | 953 | cciss_scsi_interpret_error(ctlr_info_t *h, CommandList_struct *c) |
960 | { | 954 | { |
961 | ErrorInfo_struct *ei; | 955 | ErrorInfo_struct *ei; |
962 | 956 | ||
@@ -964,67 +958,64 @@ cciss_scsi_interpret_error(CommandList_struct *c) | |||
964 | switch(ei->CommandStatus) | 958 | switch(ei->CommandStatus) |
965 | { | 959 | { |
966 | case CMD_TARGET_STATUS: | 960 | case CMD_TARGET_STATUS: |
967 | printk(KERN_WARNING "cciss: cmd %p has " | 961 | dev_warn(&h->pdev->dev, |
968 | "completed with errors\n", c); | 962 | "cmd %p has completed with errors\n", c); |
969 | printk(KERN_WARNING "cciss: cmd %p " | 963 | dev_warn(&h->pdev->dev, |
970 | "has SCSI Status = %x\n", | 964 | "cmd %p has SCSI Status = %x\n", |
971 | c, ei->ScsiStatus); | 965 | c, ei->ScsiStatus); |
972 | if (ei->ScsiStatus == 0) | 966 | if (ei->ScsiStatus == 0) |
973 | printk(KERN_WARNING | 967 | dev_warn(&h->pdev->dev, |
974 | "cciss:SCSI status is abnormally zero. " | 968 | "SCSI status is abnormally zero. " |
975 | "(probably indicates selection timeout " | 969 | "(probably indicates selection timeout " |
976 | "reported incorrectly due to a known " | 970 | "reported incorrectly due to a known " |
977 | "firmware bug, circa July, 2001.)\n"); | 971 | "firmware bug, circa July, 2001.)\n"); |
978 | break; | 972 | break; |
979 | case CMD_DATA_UNDERRUN: /* let mid layer handle it. */ | 973 | case CMD_DATA_UNDERRUN: /* let mid layer handle it. */ |
980 | printk("UNDERRUN\n"); | 974 | dev_info(&h->pdev->dev, "UNDERRUN\n"); |
981 | break; | 975 | break; |
982 | case CMD_DATA_OVERRUN: | 976 | case CMD_DATA_OVERRUN: |
983 | printk(KERN_WARNING "cciss: %p has" | 977 | dev_warn(&h->pdev->dev, "%p has" |
984 | " completed with data overrun " | 978 | " completed with data overrun " |
985 | "reported\n", c); | 979 | "reported\n", c); |
986 | break; | 980 | break; |
987 | case CMD_INVALID: { | 981 | case CMD_INVALID: { |
988 | /* controller unfortunately reports SCSI passthru's */ | 982 | /* controller unfortunately reports SCSI passthru's */ |
989 | /* to non-existent targets as invalid commands. */ | 983 | /* to non-existent targets as invalid commands. */ |
990 | printk(KERN_WARNING "cciss: %p is " | 984 | dev_warn(&h->pdev->dev, |
991 | "reported invalid (probably means " | 985 | "%p is reported invalid (probably means " |
992 | "target device no longer present)\n", c); | 986 | "target device no longer present)\n", c); |
993 | /* print_bytes((unsigned char *) c, sizeof(*c), 1, 0); | 987 | /* print_bytes((unsigned char *) c, sizeof(*c), 1, 0); |
994 | print_cmd(c); */ | 988 | print_cmd(c); */ |
995 | } | 989 | } |
996 | break; | 990 | break; |
997 | case CMD_PROTOCOL_ERR: | 991 | case CMD_PROTOCOL_ERR: |
998 | printk(KERN_WARNING "cciss: %p has " | 992 | dev_warn(&h->pdev->dev, "%p has protocol error\n", c); |
999 | "protocol error\n", c); | ||
1000 | break; | 993 | break; |
1001 | case CMD_HARDWARE_ERR: | 994 | case CMD_HARDWARE_ERR: |
1002 | /* cmd->result = DID_ERROR << 16; */ | 995 | /* cmd->result = DID_ERROR << 16; */ |
1003 | printk(KERN_WARNING "cciss: %p had " | 996 | dev_warn(&h->pdev->dev, "%p had hardware error\n", c); |
1004 | " hardware error\n", c); | ||
1005 | break; | 997 | break; |
1006 | case CMD_CONNECTION_LOST: | 998 | case CMD_CONNECTION_LOST: |
1007 | printk(KERN_WARNING "cciss: %p had " | 999 | dev_warn(&h->pdev->dev, "%p had connection lost\n", c); |
1008 | "connection lost\n", c); | ||
1009 | break; | 1000 | break; |
1010 | case CMD_ABORTED: | 1001 | case CMD_ABORTED: |
1011 | printk(KERN_WARNING "cciss: %p was " | 1002 | dev_warn(&h->pdev->dev, "%p was aborted\n", c); |
1012 | "aborted\n", c); | ||
1013 | break; | 1003 | break; |
1014 | case CMD_ABORT_FAILED: | 1004 | case CMD_ABORT_FAILED: |
1015 | printk(KERN_WARNING "cciss: %p reports " | 1005 | dev_warn(&h->pdev->dev, |
1016 | "abort failed\n", c); | 1006 | "%p reports abort failed\n", c); |
1017 | break; | 1007 | break; |
1018 | case CMD_UNSOLICITED_ABORT: | 1008 | case CMD_UNSOLICITED_ABORT: |
1019 | printk(KERN_WARNING "cciss: %p aborted " | 1009 | dev_warn(&h->pdev->dev, |
1020 | "do to an unsolicited abort\n", c); | 1010 | "%p aborted do to an unsolicited abort\n", c); |
1021 | break; | 1011 | break; |
1022 | case CMD_TIMEOUT: | 1012 | case CMD_TIMEOUT: |
1023 | printk(KERN_WARNING "cciss: %p timedout\n", c); | 1013 | dev_warn(&h->pdev->dev, "%p timedout\n", c); |
1024 | break; | 1014 | break; |
1025 | default: | 1015 | default: |
1026 | printk(KERN_WARNING "cciss: %p returned " | 1016 | dev_warn(&h->pdev->dev, |
1027 | "unknown status %x\n", c, ei->CommandStatus); | 1017 | "%p returned unknown status %x\n", |
1018 | c, ei->CommandStatus); | ||
1028 | } | 1019 | } |
1029 | } | 1020 | } |
1030 | 1021 | ||
@@ -1063,7 +1054,7 @@ cciss_scsi_do_inquiry(ctlr_info_t *h, unsigned char *scsi3addr, | |||
1063 | 1054 | ||
1064 | if (ei->CommandStatus != 0 && | 1055 | if (ei->CommandStatus != 0 && |
1065 | ei->CommandStatus != CMD_DATA_UNDERRUN) { | 1056 | ei->CommandStatus != CMD_DATA_UNDERRUN) { |
1066 | cciss_scsi_interpret_error(c); | 1057 | cciss_scsi_interpret_error(h, c); |
1067 | rc = -1; | 1058 | rc = -1; |
1068 | } | 1059 | } |
1069 | spin_lock_irqsave(&h->lock, flags); | 1060 | spin_lock_irqsave(&h->lock, flags); |
@@ -1134,7 +1125,7 @@ cciss_scsi_do_report_phys_luns(ctlr_info_t *h, | |||
1134 | ei = c->err_info; | 1125 | ei = c->err_info; |
1135 | if (ei->CommandStatus != 0 && | 1126 | if (ei->CommandStatus != 0 && |
1136 | ei->CommandStatus != CMD_DATA_UNDERRUN) { | 1127 | ei->CommandStatus != CMD_DATA_UNDERRUN) { |
1137 | cciss_scsi_interpret_error(c); | 1128 | cciss_scsi_interpret_error(h, c); |
1138 | rc = -1; | 1129 | rc = -1; |
1139 | } | 1130 | } |
1140 | spin_lock_irqsave(&h->lock, flags); | 1131 | spin_lock_irqsave(&h->lock, flags); |
@@ -1446,7 +1437,7 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd | |||
1446 | c = scsi_cmd_alloc(h); | 1437 | c = scsi_cmd_alloc(h); |
1447 | spin_unlock_irqrestore(&h->lock, flags); | 1438 | spin_unlock_irqrestore(&h->lock, flags); |
1448 | if (c == NULL) { /* trouble... */ | 1439 | if (c == NULL) { /* trouble... */ |
1449 | printk("scsi_cmd_alloc returned NULL!\n"); | 1440 | dev_warn(&h->pdev->dev, "scsi_cmd_alloc returned NULL!\n"); |
1450 | /* FIXME: next 3 lines are -> BAD! <- */ | 1441 | /* FIXME: next 3 lines are -> BAD! <- */ |
1451 | cmd->result = DID_NO_CONNECT << 16; | 1442 | cmd->result = DID_NO_CONNECT << 16; |
1452 | done(cmd); | 1443 | done(cmd); |
@@ -1502,7 +1493,7 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd | |||
1502 | break; | 1493 | break; |
1503 | 1494 | ||
1504 | default: | 1495 | default: |
1505 | printk("cciss: unknown data direction: %d\n", | 1496 | dev_warn(&h->pdev->dev, "unknown data direction: %d\n", |
1506 | cmd->sc_data_direction); | 1497 | cmd->sc_data_direction); |
1507 | BUG(); | 1498 | BUG(); |
1508 | break; | 1499 | break; |
@@ -1552,8 +1543,7 @@ static int cciss_engage_scsi(ctlr_info_t *h) | |||
1552 | stk = &sa->cmd_stack; | 1543 | stk = &sa->cmd_stack; |
1553 | 1544 | ||
1554 | if (sa->registered) { | 1545 | if (sa->registered) { |
1555 | printk(KERN_INFO "cciss%d: SCSI subsystem already engaged.\n", | 1546 | dev_info(&h->pdev->dev, "SCSI subsystem already engaged.\n"); |
1556 | h->ctlr); | ||
1557 | spin_unlock_irqrestore(&h->lock, flags); | 1547 | spin_unlock_irqrestore(&h->lock, flags); |
1558 | return -ENXIO; | 1548 | return -ENXIO; |
1559 | } | 1549 | } |
@@ -1586,8 +1576,8 @@ static int wait_for_device_to_become_ready(ctlr_info_t *h, | |||
1586 | 1576 | ||
1587 | c = cmd_alloc(h); | 1577 | c = cmd_alloc(h); |
1588 | if (!c) { | 1578 | if (!c) { |
1589 | printk(KERN_WARNING "cciss%d: out of memory in " | 1579 | dev_warn(&h->pdev->dev, "out of memory in " |
1590 | "wait_for_device_to_become_ready.\n", h->ctlr); | 1580 | "wait_for_device_to_become_ready.\n"); |
1591 | return IO_ERROR; | 1581 | return IO_ERROR; |
1592 | } | 1582 | } |
1593 | 1583 | ||
@@ -1631,16 +1621,16 @@ static int wait_for_device_to_become_ready(ctlr_info_t *h, | |||
1631 | } | 1621 | } |
1632 | } | 1622 | } |
1633 | retry_tur: | 1623 | retry_tur: |
1634 | printk(KERN_WARNING "cciss%d: Waiting %d secs " | 1624 | dev_warn(&h->pdev->dev, "Waiting %d secs " |
1635 | "for device to become ready.\n", | 1625 | "for device to become ready.\n", |
1636 | h->ctlr, waittime / HZ); | 1626 | waittime / HZ); |
1637 | rc = 1; /* device not ready. */ | 1627 | rc = 1; /* device not ready. */ |
1638 | } | 1628 | } |
1639 | 1629 | ||
1640 | if (rc) | 1630 | if (rc) |
1641 | printk("cciss%d: giving up on device.\n", h->ctlr); | 1631 | dev_warn(&h->pdev->dev, "giving up on device.\n"); |
1642 | else | 1632 | else |
1643 | printk(KERN_WARNING "cciss%d: device is ready.\n", h->ctlr); | 1633 | dev_warn(&h->pdev->dev, "device is ready.\n"); |
1644 | 1634 | ||
1645 | cmd_free(h, c); | 1635 | cmd_free(h, c); |
1646 | return rc; | 1636 | return rc; |
@@ -1668,8 +1658,7 @@ static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd) | |||
1668 | h = (ctlr_info_t *) scsicmd->device->host->hostdata[0]; | 1658 | h = (ctlr_info_t *) scsicmd->device->host->hostdata[0]; |
1669 | if (h == NULL) /* paranoia */ | 1659 | if (h == NULL) /* paranoia */ |
1670 | return FAILED; | 1660 | return FAILED; |
1671 | printk(KERN_WARNING | 1661 | dev_warn(&h->pdev->dev, "resetting tape drive or medium changer.\n"); |
1672 | "cciss%d: resetting tape drive or medium changer.\n", h->ctlr); | ||
1673 | /* find the command that's giving us trouble */ | 1662 | /* find the command that's giving us trouble */ |
1674 | cmd_in_trouble = (CommandList_struct *) scsicmd->host_scribble; | 1663 | cmd_in_trouble = (CommandList_struct *) scsicmd->host_scribble; |
1675 | if (cmd_in_trouble == NULL) /* paranoia */ | 1664 | if (cmd_in_trouble == NULL) /* paranoia */ |
@@ -1680,7 +1669,7 @@ static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd) | |||
1680 | TYPE_MSG); | 1669 | TYPE_MSG); |
1681 | if (rc == 0 && wait_for_device_to_become_ready(h, lunaddr) == 0) | 1670 | if (rc == 0 && wait_for_device_to_become_ready(h, lunaddr) == 0) |
1682 | return SUCCESS; | 1671 | return SUCCESS; |
1683 | printk(KERN_WARNING "cciss%d: resetting device failed.\n", h->ctlr); | 1672 | dev_warn(&h->pdev->dev, "resetting device failed.\n"); |
1684 | return FAILED; | 1673 | return FAILED; |
1685 | } | 1674 | } |
1686 | 1675 | ||
@@ -1695,7 +1684,7 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd) | |||
1695 | h = (ctlr_info_t *) scsicmd->device->host->hostdata[0]; | 1684 | h = (ctlr_info_t *) scsicmd->device->host->hostdata[0]; |
1696 | if (h == NULL) /* paranoia */ | 1685 | if (h == NULL) /* paranoia */ |
1697 | return FAILED; | 1686 | return FAILED; |
1698 | printk(KERN_WARNING "cciss%d: aborting tardy SCSI cmd\n", h->ctlr); | 1687 | dev_warn(&h->pdev->dev, "aborting tardy SCSI cmd\n"); |
1699 | 1688 | ||
1700 | /* find the command to be aborted */ | 1689 | /* find the command to be aborted */ |
1701 | cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble; | 1690 | cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble; |