[PATCH 29/36] aha1542: Change aha1542_set_bus_times parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxx>
---
 drivers/scsi/aha1542.c |   34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 12b90a2..6e44a7f 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -756,38 +756,36 @@ static u8 dma_speed_hw(int dma_speed)
 }
 
 /* Set the Bus on/off-times as not to ruin floppy performance */
-static void aha1542_set_bus_times(int indx)
+static void aha1542_set_bus_times(struct Scsi_Host *sh, int bus_on, int bus_off, int dma_speed)
 {
-	unsigned int base_io = io[indx];
-
-	if (bus_on[indx] > 0) {
-		u8 oncmd[] = { CMD_BUSON_TIME, clamp(bus_on[indx], 2, 15) };
+	if (bus_on > 0) {
+		u8 oncmd[] = { CMD_BUSON_TIME, clamp(bus_on, 2, 15) };
 
-		aha1542_intr_reset(base_io);
-		if (aha1542_out(base_io, oncmd, 2))
+		aha1542_intr_reset(sh->io_port);
+		if (aha1542_out(sh->io_port, oncmd, 2))
 			goto fail;
 	}
 
-	if (bus_off[indx] > 0) {
-		u8 offcmd[] = { CMD_BUSOFF_TIME, clamp(bus_off[indx], 1, 64) };
+	if (bus_off > 0) {
+		u8 offcmd[] = { CMD_BUSOFF_TIME, clamp(bus_off, 1, 64) };
 
-		aha1542_intr_reset(base_io);
-		if (aha1542_out(base_io, offcmd, 2))
+		aha1542_intr_reset(sh->io_port);
+		if (aha1542_out(sh->io_port, offcmd, 2))
 			goto fail;
 	}
 
-	if (dma_speed_hw(dma_speed[indx]) != 0xff) {
-		u8 dmacmd[] = { CMD_DMASPEED, dma_speed_hw(dma_speed[indx]) };
+	if (dma_speed_hw(dma_speed) != 0xff) {
+		u8 dmacmd[] = { CMD_DMASPEED, dma_speed_hw(dma_speed) };
 
-		aha1542_intr_reset(base_io);
-		if (aha1542_out(base_io, dmacmd, 2))
+		aha1542_intr_reset(sh->io_port);
+		if (aha1542_out(sh->io_port, dmacmd, 2))
 			goto fail;
 	}
-	aha1542_intr_reset(base_io);
+	aha1542_intr_reset(sh->io_port);
 	return;
 fail:
 	printk(KERN_ERR "setting bus on/off-time failed\n");
-	aha1542_intr_reset(base_io);
+	aha1542_intr_reset(sh->io_port);
 }
 
 /* return non-zero on detection */
@@ -817,7 +815,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct
 	if (!aha1542_test_port(sh))
 		goto unregister;
 
-	aha1542_set_bus_times(indx);
+	aha1542_set_bus_times(sh, bus_on[indx], bus_off[indx], dma_speed[indx]);
 	if (aha1542_query(sh))
 		goto unregister;
 	if (aha1542_getconfig(sh) == -1)
-- 
Ondrej Zary

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux