aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-02-06 17:11:39 -0500
committerJames Bottomley <JBottomley@Odin.com>2015-04-09 21:07:54 -0400
commit23e6940a9ecfc6477fb1216cad062e2fa12ea98f (patch)
tree08a41d6cf05e40fe6070a53c013199196b206921
parentb847fd0d85060fa213a14fa78b46e0ca5b09c5df (diff)
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: 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.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index b8e495243cf6..4849d02661d8 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -185,6 +185,8 @@ static int aha1542_out(unsigned int base, u8 *cmdp, int len)
185 outb(*cmdp++, DATA(base)); 185 outb(*cmdp++, DATA(base));
186 } 186 }
187 spin_unlock_irqrestore(&aha1542_lock, flags); 187 spin_unlock_irqrestore(&aha1542_lock, flags);
188 if (!wait_mask(INTRFLAGS(base), INTRMASK, HACC, 0, 0))
189 return 1;
188 190
189 return 0; 191 return 0;
190} 192}
@@ -650,8 +652,7 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
650 }; 652 };
651 aha1542_intr_reset(bse); /* reset interrupts, so they don't block */ 653 aha1542_intr_reset(bse); /* reset interrupts, so they don't block */
652 any2scsi((cmd + 2), isa_virt_to_bus(mb)); 654 any2scsi((cmd + 2), isa_virt_to_bus(mb));
653 aha1542_out(bse, cmd, 5); 655 if (aha1542_out(bse, cmd, 5))
654 if (!wait_mask(INTRFLAGS(bse), INTRMASK, HACC, 0, 0))
655 printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n"); 656 printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n");
656 aha1542_intr_reset(bse); 657 aha1542_intr_reset(bse);
657} 658}
@@ -744,8 +745,7 @@ static int aha1542_mbenable(int base)
744 if ((mbenable_result[0] & 0x08) && (mbenable_result[1] & 0x03)) 745 if ((mbenable_result[0] & 0x08) && (mbenable_result[1] & 0x03))
745 retval = BIOS_TRANSLATION_25563; 746 retval = BIOS_TRANSLATION_25563;
746 747
747 aha1542_out(base, mbenable_cmd, 3); 748 if (aha1542_out(base, mbenable_cmd, 3))
748 if (!wait_mask(INTRFLAGS(base), INTRMASK, HACC, 0, 0))
749 goto fail; 749 goto fail;
750 }; 750 };
751 while (0) { 751 while (0) {
@@ -879,19 +879,16 @@ static void aha1542_set_bus_times(int indx)
879 offcmd[1] = setup_busoff[indx]; 879 offcmd[1] = setup_busoff[indx];
880 } 880 }
881 aha1542_intr_reset(base_io); 881 aha1542_intr_reset(base_io);
882 aha1542_out(base_io, oncmd, 2); 882 if (aha1542_out(base_io, oncmd, 2))
883 if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0))
884 goto fail; 883 goto fail;
885 aha1542_intr_reset(base_io); 884 aha1542_intr_reset(base_io);
886 aha1542_out(base_io, offcmd, 2); 885 if (aha1542_out(base_io, offcmd, 2))
887 if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0))
888 goto fail; 886 goto fail;
889 if (setup_dmaspeed[indx] >= 0) { 887 if (setup_dmaspeed[indx] >= 0) {
890 u8 dmacmd[] = {CMD_DMASPEED, 0}; 888 u8 dmacmd[] = {CMD_DMASPEED, 0};
891 dmacmd[1] = setup_dmaspeed[indx]; 889 dmacmd[1] = setup_dmaspeed[indx];
892 aha1542_intr_reset(base_io); 890 aha1542_intr_reset(base_io);
893 aha1542_out(base_io, dmacmd, 2); 891 if (aha1542_out(base_io, dmacmd, 2))
894 if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0))
895 goto fail; 892 goto fail;
896 } 893 }
897 aha1542_intr_reset(base_io); 894 aha1542_intr_reset(base_io);