From 32ca1b05669e367ac9e46cda2d1611097bdc93fc Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 21 Sep 2003 01:41:38 -0700 Subject: [PATCH] [PATCH] NCR5380 timeout fix From: Wagner_Volanin I have an old Genius Colorpage-SP2 SCSI scanner. It is shipped with a MS-PNR 8bit ISA non-pnp proprietary SCSI card from Microtek. Although its chipset is a NCR53c400a, it wouldn't work with the appropriate driver, always accusing timeout, whatever settings I passed to it. Today I messed a little with the NCR5380.c file in drivers/scsi which is included by the g_NCR5380 driver and I couldn't understand one thing: Why the function NCR5380_poll_politely() returned the value 'r' on success if this value should be '0' case everything went ok... So I changed "return r;" to "return 0;" and after that my scanner worked fine, and was easily detected by SANE, without a single error message. :) I have not the time to delve into the problem further, but I wanted to report this. I couldn't find any counter-effects caused by changing these return values. (Acked by Alan) --- drivers/scsi/NCR5380.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 7262cca5529e7..ff77a2887b8fa 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -372,7 +372,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i { r = NCR5380_read(reg); if((r & bit) == val) - return r; + return 0; cpu_relax(); } @@ -381,7 +381,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i { r = NCR5380_read(reg); if((r & bit) == val) - return r; + return 0; if(!in_interrupt()) yield(); else -- 2.53.0