]>
Commit | Line | Data |
---|---|---|
6cbd67ed GKH |
1 | From 7bb9c75436212813b38700c34df4bbb6eb82debe Mon Sep 17 00:00:00 2001 |
2 | From: Shmulik Ladkani <shmulik.ladkani@gmail.com> | |
3 | Date: Sun, 10 Jun 2012 13:58:12 +0300 | |
4 | Subject: mtd: nand: Use the mirror BBT descriptor when reading its version | |
5 | ||
6 | From: Shmulik Ladkani <shmulik.ladkani@gmail.com> | |
7 | ||
8 | commit 7bb9c75436212813b38700c34df4bbb6eb82debe upstream. | |
9 | ||
10 | The code responsible for reading the version of the mirror bbt was | |
11 | incorrectly using the descriptor of the main bbt. | |
12 | ||
13 | Pass the mirror bbt descriptor to 'scan_read_raw' when reading the | |
14 | version of the mirror bbt. | |
15 | ||
16 | Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> | |
17 | Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> | |
18 | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | |
19 | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> | |
20 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
21 | ||
22 | --- | |
23 | drivers/mtd/nand/nand_bbt.c | 2 +- | |
24 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
25 | ||
26 | --- a/drivers/mtd/nand/nand_bbt.c | |
27 | +++ b/drivers/mtd/nand/nand_bbt.c | |
28 | @@ -390,7 +390,7 @@ static int read_abs_bbts(struct mtd_info | |
29 | /* Read the mirror version, if available */ | |
30 | if (md && (md->options & NAND_BBT_VERSION)) { | |
31 | scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift, | |
32 | - mtd->writesize, td); | |
33 | + mtd->writesize, md); | |
34 | md->version[0] = buf[bbt_get_ver_offs(mtd, md)]; | |
35 | pr_info("Bad block table at page %d, version 0x%02X\n", | |
36 | md->pages[0], md->version[0]); |