Skip to content

Commit

Permalink
pata_bf54x: decrease count first.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Jeff Garzik committed Apr 25, 2008
1 parent 85afb93 commit f9d4249
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/pata_bf54x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ static int bfin_reset_controller(struct ata_host *host)
count = 10000000;
do {
status = read_atapi_register(base, ATA_REG_STATUS);
} while (count-- && (status & ATA_BUSY));
} while (--count && (status & ATA_BUSY));

/* Enable only ATAPI Device interrupt */
ATAPI_SET_INT_MASK(base, 1);
Expand Down

0 comments on commit f9d4249

Please sign in to comment.