diff options
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 21a2cc8636df..d31cb7b3feeb 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -366,23 +366,21 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat, | |||
366 | ((diff2 ^ (diff2 >> 1)) & 0x55) == 0x55) { | 366 | ((diff2 ^ (diff2 >> 1)) & 0x55) == 0x55) { |
367 | /* calculate the bit position of the error */ | 367 | /* calculate the bit position of the error */ |
368 | 368 | ||
369 | bit = (diff2 >> 2) & 1; | 369 | bit = ((diff2 >> 3) & 1) | |
370 | bit |= (diff2 >> 3) & 2; | 370 | ((diff2 >> 4) & 2) | |
371 | bit |= (diff2 >> 4) & 4; | 371 | ((diff2 >> 5) & 4); |
372 | 372 | ||
373 | /* calculate the byte position of the error */ | 373 | /* calculate the byte position of the error */ |
374 | 374 | ||
375 | byte = (diff1 << 1) & 0x80; | 375 | byte = ((diff2 << 7) & 0x100) | |
376 | byte |= (diff1 << 2) & 0x40; | 376 | ((diff1 << 0) & 0x80) | |
377 | byte |= (diff1 << 3) & 0x20; | 377 | ((diff1 << 1) & 0x40) | |
378 | byte |= (diff1 << 4) & 0x10; | 378 | ((diff1 << 2) & 0x20) | |
379 | 379 | ((diff1 << 3) & 0x10) | | |
380 | byte |= (diff0 >> 3) & 0x08; | 380 | ((diff0 >> 4) & 0x08) | |
381 | byte |= (diff0 >> 2) & 0x04; | 381 | ((diff0 >> 3) & 0x04) | |
382 | byte |= (diff0 >> 1) & 0x02; | 382 | ((diff0 >> 2) & 0x02) | |
383 | byte |= (diff0 >> 0) & 0x01; | 383 | ((diff0 >> 1) & 0x01); |
384 | |||
385 | byte |= (diff2 << 8) & 0x100; | ||
386 | 384 | ||
387 | dev_dbg(info->device, "correcting error bit %d, byte %d\n", | 385 | dev_dbg(info->device, "correcting error bit %d, byte %d\n", |
388 | bit, byte); | 386 | bit, byte); |