aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-02-06 17:11:50 -0500
committerJames Bottomley <JBottomley@Odin.com>2015-04-09 21:08:56 -0400
commit37d607bd7944ce8d9d7b3baecc4f0ca725240fb8 (patch)
treeb87f6180c58db89993552acd0e4de1fc26bd5cdc
parent68ea9de3a6256195ab4d92fa7d0edf6ed657a500 (diff)
aha1542: Change aha1542_set_bus_times parameters
Pass struct Scsi_Host *sh and dma parameters instead of index to aha1542_set_bus_times. This is required for printk conversion. 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.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 12b90a2325c8..6e44a7fb67ca 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -756,38 +756,36 @@ static u8 dma_speed_hw(int dma_speed)
756} 756}
757 757
758/* Set the Bus on/off-times as not to ruin floppy performance */ 758/* Set the Bus on/off-times as not to ruin floppy performance */
759static void aha1542_set_bus_times(int indx) 759static void aha1542_set_bus_times(struct Scsi_Host *sh, int bus_on, int bus_off, int dma_speed)
760{ 760{
761 unsigned int base_io = io[indx]; 761 if (bus_on > 0) {
762 762 u8 oncmd[] = { CMD_BUSON_TIME, clamp(bus_on, 2, 15) };
763 if (bus_on[indx] > 0) {
764 u8 oncmd[] = { CMD_BUSON_TIME, clamp(bus_on[indx], 2, 15) };
765 763
766 aha1542_intr_reset(base_io); 764 aha1542_intr_reset(sh->io_port);
767 if (aha1542_out(base_io, oncmd, 2)) 765 if (aha1542_out(sh->io_port, oncmd, 2))
768 goto fail; 766 goto fail;
769 } 767 }
770 768
771 if (bus_off[indx] > 0) { 769 if (bus_off > 0) {
772 u8 offcmd[] = { CMD_BUSOFF_TIME, clamp(bus_off[indx], 1, 64) }; 770 u8 offcmd[] = { CMD_BUSOFF_TIME, clamp(bus_off, 1, 64) };
773 771
774 aha1542_intr_reset(base_io); 772 aha1542_intr_reset(sh->io_port);
775 if (aha1542_out(base_io, offcmd, 2)) 773 if (aha1542_out(sh->io_port, offcmd, 2))
776 goto fail; 774 goto fail;
777 } 775 }
778 776
779 if (dma_speed_hw(dma_speed[indx]) != 0xff) { 777 if (dma_speed_hw(dma_speed) != 0xff) {
780 u8 dmacmd[] = { CMD_DMASPEED, dma_speed_hw(dma_speed[indx]) }; 778 u8 dmacmd[] = { CMD_DMASPEED, dma_speed_hw(dma_speed) };
781 779
782 aha1542_intr_reset(base_io); 780 aha1542_intr_reset(sh->io_port);
783 if (aha1542_out(base_io, dmacmd, 2)) 781 if (aha1542_out(sh->io_port, dmacmd, 2))
784 goto fail; 782 goto fail;
785 } 783 }
786 aha1542_intr_reset(base_io); 784 aha1542_intr_reset(sh->io_port);
787 return; 785 return;
788fail: 786fail:
789 printk(KERN_ERR "setting bus on/off-time failed\n"); 787 printk(KERN_ERR "setting bus on/off-time failed\n");
790 aha1542_intr_reset(base_io); 788 aha1542_intr_reset(sh->io_port);
791} 789}
792 790
793/* return non-zero on detection */ 791/* return non-zero on detection */
@@ -817,7 +815,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct
817 if (!aha1542_test_port(sh)) 815 if (!aha1542_test_port(sh))
818 goto unregister; 816 goto unregister;
819 817
820 aha1542_set_bus_times(indx); 818 aha1542_set_bus_times(sh, bus_on[indx], bus_off[indx], dma_speed[indx]);
821 if (aha1542_query(sh)) 819 if (aha1542_query(sh))
822 goto unregister; 820 goto unregister;
823 if (aha1542_getconfig(sh) == -1) 821 if (aha1542_getconfig(sh) == -1)