diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:51 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:09:01 -0400 |
commit | 2906b3ceb1bfc4a1abd59dd7a5f09268b8d585a6 (patch) | |
tree | 987d08b081f0ad966c37e21d81ef3f5411554e03 | |
parent | 37d607bd7944ce8d9d7b3baecc4f0ca725240fb8 (diff) |
aha1542: Use shost_printk instead of printk
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/aha1542.c | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 6e44a7fb67ca..d607f59f922a 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -105,10 +105,8 @@ static int aha1542_outb(unsigned int base, u8 val) | |||
105 | unsigned long flags; | 105 | unsigned long flags; |
106 | 106 | ||
107 | while (1) { | 107 | while (1) { |
108 | if (!wait_mask(STATUS(base), CDF, 0, CDF, 0)) { | 108 | if (!wait_mask(STATUS(base), CDF, 0, CDF, 0)) |
109 | printk(KERN_ERR "aha1542_outb failed"); | ||
110 | return 1; | 109 | return 1; |
111 | } | ||
112 | spin_lock_irqsave(&aha1542_lock, flags); | 110 | spin_lock_irqsave(&aha1542_lock, flags); |
113 | if (inb(STATUS(base)) & CDF) { | 111 | if (inb(STATUS(base)) & CDF) { |
114 | spin_unlock_irqrestore(&aha1542_lock, flags); | 112 | spin_unlock_irqrestore(&aha1542_lock, flags); |
@@ -128,7 +126,6 @@ static int aha1542_out(unsigned int base, u8 *buf, int len) | |||
128 | while (len--) { | 126 | while (len--) { |
129 | if (!wait_mask(STATUS(base), CDF, 0, CDF, 0)) { | 127 | if (!wait_mask(STATUS(base), CDF, 0, CDF, 0)) { |
130 | spin_unlock_irqrestore(&aha1542_lock, flags); | 128 | spin_unlock_irqrestore(&aha1542_lock, flags); |
131 | printk(KERN_ERR "aha1542_out failed(%d): ", len + 1); | ||
132 | return 1; | 129 | return 1; |
133 | } | 130 | } |
134 | outb(*buf++, DATA(base)); | 131 | outb(*buf++, DATA(base)); |
@@ -151,8 +148,6 @@ static int aha1542_in(unsigned int base, u8 *buf, int len, int timeout) | |||
151 | while (len--) { | 148 | while (len--) { |
152 | if (!wait_mask(STATUS(base), DF, DF, 0, timeout)) { | 149 | if (!wait_mask(STATUS(base), DF, DF, 0, timeout)) { |
153 | spin_unlock_irqrestore(&aha1542_lock, flags); | 150 | spin_unlock_irqrestore(&aha1542_lock, flags); |
154 | if (timeout == 0) | ||
155 | printk(KERN_ERR "aha1542_in failed(%d): ", len + 1); | ||
156 | return 1; | 151 | return 1; |
157 | } | 152 | } |
158 | *buf++ = inb(DATA(base)); | 153 | *buf++ = inb(DATA(base)); |
@@ -284,7 +279,7 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
284 | #ifdef DEBUG | 279 | #ifdef DEBUG |
285 | { | 280 | { |
286 | flag = inb(INTRFLAGS(sh->io_port)); | 281 | flag = inb(INTRFLAGS(sh->io_port)); |
287 | printk(KERN_DEBUG "aha1542_intr_handle: "); | 282 | shost_printk(KERN_DEBUG, sh, "aha1542_intr_handle: "); |
288 | if (!(flag & ANYINTR)) | 283 | if (!(flag & ANYINTR)) |
289 | printk("no interrupt?"); | 284 | printk("no interrupt?"); |
290 | if (flag & MBIF) | 285 | if (flag & MBIF) |
@@ -334,7 +329,7 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
334 | spin_unlock_irqrestore(&aha1542_lock, flags); | 329 | spin_unlock_irqrestore(&aha1542_lock, flags); |
335 | /* Hmm, no mail. Must have read it the last time around */ | 330 | /* Hmm, no mail. Must have read it the last time around */ |
336 | if (!number_serviced) | 331 | if (!number_serviced) |
337 | printk(KERN_WARNING "aha1542.c: interrupt received, but no mail.\n"); | 332 | shost_printk(KERN_WARNING, sh, "interrupt received, but no mail.\n"); |
338 | return; | 333 | return; |
339 | }; | 334 | }; |
340 | 335 | ||
@@ -347,7 +342,7 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
347 | #ifdef DEBUG | 342 | #ifdef DEBUG |
348 | { | 343 | { |
349 | if (ccb[mbo].tarstat | ccb[mbo].hastat) | 344 | if (ccb[mbo].tarstat | ccb[mbo].hastat) |
350 | printk(KERN_DEBUG "aha1542_command: returning %x (status %d)\n", | 345 | shost_printk(KERN_DEBUG, sh, "aha1542_command: returning %x (status %d)\n", |
351 | ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); | 346 | ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); |
352 | }; | 347 | }; |
353 | #endif | 348 | #endif |
@@ -356,14 +351,14 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
356 | continue; /* Aborted command not found */ | 351 | continue; /* Aborted command not found */ |
357 | 352 | ||
358 | #ifdef DEBUG | 353 | #ifdef DEBUG |
359 | printk(KERN_DEBUG "...done %d %d\n", mbo, mbi); | 354 | shost_printk(KERN_DEBUG, sh, "...done %d %d\n", mbo, mbi); |
360 | #endif | 355 | #endif |
361 | 356 | ||
362 | tmp_cmd = aha1542->int_cmds[mbo]; | 357 | tmp_cmd = aha1542->int_cmds[mbo]; |
363 | 358 | ||
364 | if (!tmp_cmd || !tmp_cmd->scsi_done) { | 359 | if (!tmp_cmd || !tmp_cmd->scsi_done) { |
365 | printk(KERN_WARNING "aha1542_intr_handle: Unexpected interrupt\n"); | 360 | shost_printk(KERN_WARNING, sh, "Unexpected interrupt\n"); |
366 | printk(KERN_WARNING "tarstat=%x, hastat=%x idlun=%x ccb#=%d \n", ccb[mbo].tarstat, | 361 | shost_printk(KERN_WARNING, sh, "tarstat=%x, hastat=%x idlun=%x ccb#=%d\n", ccb[mbo].tarstat, |
367 | ccb[mbo].hastat, ccb[mbo].idlun, mbo); | 362 | ccb[mbo].hastat, ccb[mbo].idlun, mbo); |
368 | return; | 363 | return; |
369 | } | 364 | } |
@@ -389,7 +384,7 @@ static void aha1542_intr_handle(struct Scsi_Host *sh) | |||
389 | 384 | ||
390 | #ifdef DEBUG | 385 | #ifdef DEBUG |
391 | if (errstatus) | 386 | if (errstatus) |
392 | printk(KERN_DEBUG "(aha1542 error:%x %x %x) ", errstatus, | 387 | shost_printk(KERN_DEBUG, sh, "(aha1542 error:%x %x %x) ", errstatus, |
393 | ccb[mbo].hastat, ccb[mbo].tarstat); | 388 | ccb[mbo].hastat, ccb[mbo].tarstat); |
394 | #endif | 389 | #endif |
395 | 390 | ||
@@ -433,7 +428,8 @@ static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id) | |||
433 | 428 | ||
434 | static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct scsi_cmnd *)) | 429 | static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct scsi_cmnd *)) |
435 | { | 430 | { |
436 | struct aha1542_hostdata *aha1542 = shost_priv(cmd->device->host); | 431 | struct Scsi_Host *sh = cmd->device->host; |
432 | struct aha1542_hostdata *aha1542 = shost_priv(sh); | ||
437 | u8 direction; | 433 | u8 direction; |
438 | u8 target = cmd->device->id; | 434 | u8 target = cmd->device->id; |
439 | u8 lun = cmd->device->lun; | 435 | u8 lun = cmd->device->lun; |
@@ -465,10 +461,10 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
465 | else | 461 | else |
466 | i = -1; | 462 | i = -1; |
467 | if (done) | 463 | if (done) |
468 | printk(KERN_DEBUG "aha1542_queuecommand: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); | 464 | shost_printk(KERN_DEBUG, sh, "aha1542_queuecommand: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); |
469 | else | 465 | else |
470 | printk(KERN_DEBUG "aha1542_command: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); | 466 | shost_printk(KERN_DEBUG, sh, "aha1542_command: dev %d cmd %02x pos %d len %d ", target, *cmd->cmnd, i, bufflen); |
471 | printk(KERN_DEBUG "aha1542_queuecommand: dumping scsi cmd:"); | 467 | shost_printk(KERN_DEBUG, sh, "aha1542_queuecommand: dumping scsi cmd:"); |
472 | for (i = 0; i < cmd->cmd_len; i++) | 468 | for (i = 0; i < cmd->cmd_len; i++) |
473 | printk("%02x ", cmd->cmnd[i]); | 469 | printk("%02x ", cmd->cmnd[i]); |
474 | printk("\n"); | 470 | printk("\n"); |
@@ -501,7 +497,7 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
501 | spin_unlock_irqrestore(&aha1542_lock, flags); | 497 | spin_unlock_irqrestore(&aha1542_lock, flags); |
502 | 498 | ||
503 | #ifdef DEBUG | 499 | #ifdef DEBUG |
504 | printk(KERN_DEBUG "Sending command (%d %x)...", mbo, done); | 500 | shost_printk(KERN_DEBUG, sh, "Sending command (%d %x)...", mbo, done); |
505 | #endif | 501 | #endif |
506 | 502 | ||
507 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ | 503 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ |
@@ -561,7 +557,7 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
561 | #ifdef DEBUG | 557 | #ifdef DEBUG |
562 | { | 558 | { |
563 | int i; | 559 | int i; |
564 | printk(KERN_DEBUG "aha1542_command: sending.. "); | 560 | shost_printk(KERN_DEBUG, sh, "aha1542_command: sending.. "); |
565 | for (i = 0; i < sizeof(ccb[mbo]) - 10; i++) | 561 | for (i = 0; i < sizeof(ccb[mbo]) - 10; i++) |
566 | printk("%02x ", ((u8 *) &ccb[mbo])[i]); | 562 | printk("%02x ", ((u8 *) &ccb[mbo])[i]); |
567 | }; | 563 | }; |
@@ -597,7 +593,7 @@ static void setup_mailboxes(struct Scsi_Host *sh) | |||
597 | aha1542_intr_reset(sh->io_port); /* reset interrupts, so they don't block */ | 593 | aha1542_intr_reset(sh->io_port); /* reset interrupts, so they don't block */ |
598 | any2scsi((mb_cmd + 2), isa_virt_to_bus(mb)); | 594 | any2scsi((mb_cmd + 2), isa_virt_to_bus(mb)); |
599 | if (aha1542_out(sh->io_port, mb_cmd, 5)) | 595 | if (aha1542_out(sh->io_port, mb_cmd, 5)) |
600 | printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n"); | 596 | shost_printk(KERN_ERR, sh, "failed setting up mailboxes\n"); |
601 | aha1542_intr_reset(sh->io_port); | 597 | aha1542_intr_reset(sh->io_port); |
602 | } | 598 | } |
603 | 599 | ||
@@ -612,7 +608,7 @@ static int aha1542_getconfig(struct Scsi_Host *sh) | |||
612 | aha1542_outb(sh->io_port, CMD_RETCONF); | 608 | aha1542_outb(sh->io_port, CMD_RETCONF); |
613 | aha1542_in(sh->io_port, inquiry_result, 3, 0); | 609 | aha1542_in(sh->io_port, inquiry_result, 3, 0); |
614 | if (!wait_mask(INTRFLAGS(sh->io_port), INTRMASK, HACC, 0, 0)) | 610 | if (!wait_mask(INTRFLAGS(sh->io_port), INTRMASK, HACC, 0, 0)) |
615 | printk(KERN_ERR "aha1542_detect: query board settings\n"); | 611 | shost_printk(KERN_ERR, sh, "error querying board settings\n"); |
616 | aha1542_intr_reset(sh->io_port); | 612 | aha1542_intr_reset(sh->io_port); |
617 | switch (inquiry_result[0]) { | 613 | switch (inquiry_result[0]) { |
618 | case 0x80: | 614 | case 0x80: |
@@ -633,7 +629,7 @@ static int aha1542_getconfig(struct Scsi_Host *sh) | |||
633 | sh->dma_channel = 0xFF; | 629 | sh->dma_channel = 0xFF; |
634 | break; | 630 | break; |
635 | default: | 631 | default: |
636 | printk(KERN_ERR "Unable to determine Adaptec DMA priority. Disabling board\n"); | 632 | shost_printk(KERN_ERR, sh, "Unable to determine DMA channel.\n"); |
637 | return -1; | 633 | return -1; |
638 | }; | 634 | }; |
639 | switch (inquiry_result[1]) { | 635 | switch (inquiry_result[1]) { |
@@ -656,7 +652,7 @@ static int aha1542_getconfig(struct Scsi_Host *sh) | |||
656 | sh->irq = 9; | 652 | sh->irq = 9; |
657 | break; | 653 | break; |
658 | default: | 654 | default: |
659 | printk(KERN_ERR "Unable to determine Adaptec IRQ level. Disabling board\n"); | 655 | shost_printk(KERN_ERR, sh, "Unable to determine IRQ level.\n"); |
660 | return -1; | 656 | return -1; |
661 | }; | 657 | }; |
662 | sh->this_id = inquiry_result[2] & 7; | 658 | sh->this_id = inquiry_result[2] & 7; |
@@ -694,7 +690,7 @@ static int aha1542_mbenable(struct Scsi_Host *sh) | |||
694 | }; | 690 | }; |
695 | while (0) { | 691 | while (0) { |
696 | fail: | 692 | fail: |
697 | printk(KERN_ERR "aha1542_mbenable: Mailbox init failed\n"); | 693 | shost_printk(KERN_ERR, sh, "Mailbox init failed\n"); |
698 | } | 694 | } |
699 | aha1542_intr_reset(sh->io_port); | 695 | aha1542_intr_reset(sh->io_port); |
700 | return retval; | 696 | return retval; |
@@ -713,7 +709,7 @@ static int aha1542_query(struct Scsi_Host *sh) | |||
713 | aha1542_outb(sh->io_port, CMD_INQUIRY); | 709 | aha1542_outb(sh->io_port, CMD_INQUIRY); |
714 | aha1542_in(sh->io_port, inquiry_result, 4, 0); | 710 | aha1542_in(sh->io_port, inquiry_result, 4, 0); |
715 | if (!wait_mask(INTRFLAGS(sh->io_port), INTRMASK, HACC, 0, 0)) | 711 | if (!wait_mask(INTRFLAGS(sh->io_port), INTRMASK, HACC, 0, 0)) |
716 | printk(KERN_ERR "aha1542_detect: query card type\n"); | 712 | shost_printk(KERN_ERR, sh, "error querying card type\n"); |
717 | aha1542_intr_reset(sh->io_port); | 713 | aha1542_intr_reset(sh->io_port); |
718 | 714 | ||
719 | aha1542->bios_translation = BIOS_TRANSLATION_6432; /* Default case */ | 715 | aha1542->bios_translation = BIOS_TRANSLATION_6432; /* Default case */ |
@@ -725,7 +721,7 @@ static int aha1542_query(struct Scsi_Host *sh) | |||
725 | */ | 721 | */ |
726 | 722 | ||
727 | if (inquiry_result[0] == 0x43) { | 723 | if (inquiry_result[0] == 0x43) { |
728 | printk(KERN_INFO "aha1542.c: Emulation mode not supported for AHA 174N hardware.\n"); | 724 | shost_printk(KERN_INFO, sh, "Emulation mode not supported for AHA-1740 hardware, use aha1740 driver instead.\n"); |
729 | return 1; | 725 | return 1; |
730 | }; | 726 | }; |
731 | 727 | ||
@@ -784,7 +780,7 @@ static void aha1542_set_bus_times(struct Scsi_Host *sh, int bus_on, int bus_off, | |||
784 | aha1542_intr_reset(sh->io_port); | 780 | aha1542_intr_reset(sh->io_port); |
785 | return; | 781 | return; |
786 | fail: | 782 | fail: |
787 | printk(KERN_ERR "setting bus on/off-time failed\n"); | 783 | shost_printk(KERN_ERR, sh, "setting bus on/off-time failed\n"); |
788 | aha1542_intr_reset(sh->io_port); | 784 | aha1542_intr_reset(sh->io_port); |
789 | } | 785 | } |
790 | 786 | ||
@@ -794,6 +790,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct | |||
794 | unsigned int base_io = io[indx]; | 790 | unsigned int base_io = io[indx]; |
795 | struct Scsi_Host *sh; | 791 | struct Scsi_Host *sh; |
796 | struct aha1542_hostdata *aha1542; | 792 | struct aha1542_hostdata *aha1542; |
793 | char dma_info[] = "no DMA"; | ||
797 | 794 | ||
798 | if (base_io == 0) | 795 | if (base_io == 0) |
799 | return NULL; | 796 | return NULL; |
@@ -821,23 +818,23 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct | |||
821 | if (aha1542_getconfig(sh) == -1) | 818 | if (aha1542_getconfig(sh) == -1) |
822 | goto unregister; | 819 | goto unregister; |
823 | 820 | ||
824 | printk(KERN_INFO "Adaptec AHA-1542 (SCSI-ID %d) at IO 0x%x, IRQ %d", sh->this_id, base_io, sh->irq); | ||
825 | if (sh->dma_channel != 0xFF) | 821 | if (sh->dma_channel != 0xFF) |
826 | printk(", DMA %d", sh->dma_channel); | 822 | snprintf(dma_info, sizeof(dma_info), "DMA %d", sh->dma_channel); |
827 | printk("\n"); | 823 | shost_printk(KERN_INFO, sh, "Adaptec AHA-1542 (SCSI-ID %d) at IO 0x%x, IRQ %d, %s\n", |
824 | sh->this_id, base_io, sh->irq, dma_info); | ||
828 | if (aha1542->bios_translation == BIOS_TRANSLATION_25563) | 825 | if (aha1542->bios_translation == BIOS_TRANSLATION_25563) |
829 | printk(KERN_INFO "aha1542.c: Using extended bios translation\n"); | 826 | shost_printk(KERN_INFO, sh, "Using extended bios translation\n"); |
830 | 827 | ||
831 | setup_mailboxes(sh); | 828 | setup_mailboxes(sh); |
832 | 829 | ||
833 | if (request_irq(sh->irq, do_aha1542_intr_handle, 0, | 830 | if (request_irq(sh->irq, do_aha1542_intr_handle, 0, |
834 | "aha1542", sh)) { | 831 | "aha1542", sh)) { |
835 | printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n"); | 832 | shost_printk(KERN_ERR, sh, "Unable to allocate IRQ.\n"); |
836 | goto unregister; | 833 | goto unregister; |
837 | } | 834 | } |
838 | if (sh->dma_channel != 0xFF) { | 835 | if (sh->dma_channel != 0xFF) { |
839 | if (request_dma(sh->dma_channel, "aha1542")) { | 836 | if (request_dma(sh->dma_channel, "aha1542")) { |
840 | printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n"); | 837 | shost_printk(KERN_ERR, sh, "Unable to allocate DMA channel.\n"); |
841 | goto free_irq; | 838 | goto free_irq; |
842 | } | 839 | } |
843 | if (sh->dma_channel == 0 || sh->dma_channel >= 5) { | 840 | if (sh->dma_channel == 0 || sh->dma_channel >= 5) { |
@@ -979,7 +976,7 @@ static int aha1542_reset(struct scsi_cmnd *cmd, u8 reset_cmd) | |||
979 | * out. We do not try and restart any commands or anything - | 976 | * out. We do not try and restart any commands or anything - |
980 | * the strategy handler takes care of that crap. | 977 | * the strategy handler takes care of that crap. |
981 | */ | 978 | */ |
982 | printk(KERN_WARNING "Sent BUS RESET to scsi host %d\n", cmd->device->host->host_no); | 979 | shost_printk(KERN_WARNING, cmd->device->host, "Sent BUS RESET to scsi host %d\n", cmd->device->host->host_no); |
983 | 980 | ||
984 | for (i = 0; i < AHA1542_MAILBOXES; i++) { | 981 | for (i = 0; i < AHA1542_MAILBOXES; i++) { |
985 | if (aha1542->int_cmds[i] != NULL) { | 982 | if (aha1542->int_cmds[i] != NULL) { |
@@ -1105,7 +1102,7 @@ static int aha1542_pnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *i | |||
1105 | /* The card can be queried for its DMA, we have | 1102 | /* The card can be queried for its DMA, we have |
1106 | the DMA set up that is enough */ | 1103 | the DMA set up that is enough */ |
1107 | 1104 | ||
1108 | printk(KERN_INFO "ISAPnP found an AHA1535 at I/O 0x%03X\n", io[indx]); | 1105 | dev_info(&pdev->dev, "ISAPnP found an AHA1535 at I/O 0x%03X", io[indx]); |
1109 | } | 1106 | } |
1110 | 1107 | ||
1111 | sh = aha1542_hw_init(&driver_template, &pdev->dev, indx); | 1108 | sh = aha1542_hw_init(&driver_template, &pdev->dev, indx); |