Commit 23e6940a authored by Ondrej Zary's avatar Ondrej Zary Committed by James Bottomley

aha1542: Call wait_mask from aha1542_out

aha1542_out call is always followed by wait_mask.
Move the call into aha1542_out to simplify code.
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent b847fd0d
...@@ -185,6 +185,8 @@ static int aha1542_out(unsigned int base, u8 *cmdp, int len) ...@@ -185,6 +185,8 @@ static int aha1542_out(unsigned int base, u8 *cmdp, int len)
outb(*cmdp++, DATA(base)); outb(*cmdp++, DATA(base));
} }
spin_unlock_irqrestore(&aha1542_lock, flags); spin_unlock_irqrestore(&aha1542_lock, flags);
if (!wait_mask(INTRFLAGS(base), INTRMASK, HACC, 0, 0))
return 1;
return 0; return 0;
} }
...@@ -650,8 +652,7 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) ...@@ -650,8 +652,7 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
}; };
aha1542_intr_reset(bse); /* reset interrupts, so they don't block */ aha1542_intr_reset(bse); /* reset interrupts, so they don't block */
any2scsi((cmd + 2), isa_virt_to_bus(mb)); any2scsi((cmd + 2), isa_virt_to_bus(mb));
aha1542_out(bse, cmd, 5); if (aha1542_out(bse, cmd, 5))
if (!wait_mask(INTRFLAGS(bse), INTRMASK, HACC, 0, 0))
printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n"); printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n");
aha1542_intr_reset(bse); aha1542_intr_reset(bse);
} }
...@@ -744,8 +745,7 @@ static int aha1542_mbenable(int base) ...@@ -744,8 +745,7 @@ static int aha1542_mbenable(int base)
if ((mbenable_result[0] & 0x08) && (mbenable_result[1] & 0x03)) if ((mbenable_result[0] & 0x08) && (mbenable_result[1] & 0x03))
retval = BIOS_TRANSLATION_25563; retval = BIOS_TRANSLATION_25563;
aha1542_out(base, mbenable_cmd, 3); if (aha1542_out(base, mbenable_cmd, 3))
if (!wait_mask(INTRFLAGS(base), INTRMASK, HACC, 0, 0))
goto fail; goto fail;
}; };
while (0) { while (0) {
...@@ -879,19 +879,16 @@ static void aha1542_set_bus_times(int indx) ...@@ -879,19 +879,16 @@ static void aha1542_set_bus_times(int indx)
offcmd[1] = setup_busoff[indx]; offcmd[1] = setup_busoff[indx];
} }
aha1542_intr_reset(base_io); aha1542_intr_reset(base_io);
aha1542_out(base_io, oncmd, 2); if (aha1542_out(base_io, oncmd, 2))
if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0))
goto fail; goto fail;
aha1542_intr_reset(base_io); aha1542_intr_reset(base_io);
aha1542_out(base_io, offcmd, 2); if (aha1542_out(base_io, offcmd, 2))
if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0))
goto fail; goto fail;
if (setup_dmaspeed[indx] >= 0) { if (setup_dmaspeed[indx] >= 0) {
u8 dmacmd[] = {CMD_DMASPEED, 0}; u8 dmacmd[] = {CMD_DMASPEED, 0};
dmacmd[1] = setup_dmaspeed[indx]; dmacmd[1] = setup_dmaspeed[indx];
aha1542_intr_reset(base_io); aha1542_intr_reset(base_io);
aha1542_out(base_io, dmacmd, 2); if (aha1542_out(base_io, dmacmd, 2))
if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0))
goto fail; goto fail;
} }
aha1542_intr_reset(base_io); aha1542_intr_reset(base_io);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment