aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorRoel Kluin <12o3l@tiscali.nl>2008-04-24 23:37:54 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-25 01:26:28 -0400
commitf9d42491723dbb77bdc9b9dc7e096ea57d535992 (patch)
tree8373ddad57fea6c7d85e80e196395b086c994b20 /drivers/ata
parent85afb934575abdff1b2ac8ea4d522d1355f22a89 (diff)
pata_bf54x: decrease count first.
When count reaches 0 the postfix decrement still subtracts (to -1), so bfin_reset_controller() returns as if the busy flag was cleared while it was not. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_bf54x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index e4cf73c4b70b..a75de0684c15 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1417,7 +1417,7 @@ static int bfin_reset_controller(struct ata_host *host)
1417 count = 10000000; 1417 count = 10000000;
1418 do { 1418 do {
1419 status = read_atapi_register(base, ATA_REG_STATUS); 1419 status = read_atapi_register(base, ATA_REG_STATUS);
1420 } while (count-- && (status & ATA_BUSY)); 1420 } while (--count && (status & ATA_BUSY));
1421 1421
1422 /* Enable only ATAPI Device interrupt */ 1422 /* Enable only ATAPI Device interrupt */
1423 ATAPI_SET_INT_MASK(base, 1); 1423 ATAPI_SET_INT_MASK(base, 1);