From: Roel Kluin <12o3l@tiscali.nl> Date: Fri, 25 Apr 2008 03:37:54 +0000 (+0800) Subject: pata_bf54x: decrease count first. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f9d42491723dbb77bdc9b9dc7e096ea57d535992;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Bryan Wu Signed-off-by: Jeff Garzik --- 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) 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);