|
59 | 59 | * The AG-AND chips have nice features for speed improvement, |
60 | 60 | * which are not supported yet. Read / program 4 pages in one go. |
61 | 61 | * |
62 | | - * $Id: nand_base.c,v 1.132 2005/02/09 14:49:56 dedekind Exp $ |
| 62 | + * $Id: nand_base.c,v 1.133 2005/02/16 09:39:35 gleixner Exp $ |
63 | 63 | * |
64 | 64 | * This program is free software; you can redistribute it and/or modify |
65 | 65 | * it under the terms of the GNU General Public License version 2 as |
@@ -2276,7 +2276,7 @@ static int nand_block_markbad (struct mtd_info *mtd, loff_t ofs) |
2276 | 2276 | */ |
2277 | 2277 | int nand_scan (struct mtd_info *mtd, int maxchips) |
2278 | 2278 | { |
2279 | | - int i, j, nand_maf_id, nand_dev_id, busw; |
| 2279 | + int i, j, nand_maf_id, nand_dev_id, busw, maf_id; |
2280 | 2280 | struct nand_chip *this = mtd->priv; |
2281 | 2281 |
|
2282 | 2282 | /* Get buswidth to select the correct functions*/ |
@@ -2364,12 +2364,18 @@ int nand_scan (struct mtd_info *mtd, int maxchips) |
2364 | 2364 | busw = nand_flash_ids[i].options & NAND_BUSWIDTH_16; |
2365 | 2365 | } |
2366 | 2366 |
|
| 2367 | + /* Try to identify manufacturer */ |
| 2368 | + for (maf_id = 0; nand_manuf_ids[maf_id].id != 0x0; maf_id++) { |
| 2369 | + if (nand_manuf_ids[maf_id].id == nand_maf_id) |
| 2370 | + break; |
| 2371 | + } |
| 2372 | + |
2367 | 2373 | /* Check, if buswidth is correct. Hardware drivers should set |
2368 | 2374 | * this correct ! */ |
2369 | 2375 | if (busw != (this->options & NAND_BUSWIDTH_16)) { |
2370 | 2376 | printk (KERN_INFO "NAND device: Manufacturer ID:" |
2371 | 2377 | " 0x%02x, Chip ID: 0x%02x (%s %s)\n", nand_maf_id, nand_dev_id, |
2372 | | - nand_manuf_ids[i].name , mtd->name); |
| 2378 | + nand_manuf_ids[maf_id].name , mtd->name); |
2373 | 2379 | printk (KERN_WARNING |
2374 | 2380 | "NAND bus width %d instead %d bit\n", |
2375 | 2381 | (this->options & NAND_BUSWIDTH_16) ? 16 : 8, |
@@ -2408,14 +2414,9 @@ int nand_scan (struct mtd_info *mtd, int maxchips) |
2408 | 2414 | if (mtd->oobblock > 512 && this->cmdfunc == nand_command) |
2409 | 2415 | this->cmdfunc = nand_command_lp; |
2410 | 2416 |
|
2411 | | - /* Try to identify manufacturer */ |
2412 | | - for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { |
2413 | | - if (nand_manuf_ids[j].id == nand_maf_id) |
2414 | | - break; |
2415 | | - } |
2416 | 2417 | printk (KERN_INFO "NAND device: Manufacturer ID:" |
2417 | 2418 | " 0x%02x, Chip ID: 0x%02x (%s %s)\n", nand_maf_id, nand_dev_id, |
2418 | | - nand_manuf_ids[j].name , nand_flash_ids[i].name); |
| 2419 | + nand_manuf_ids[maf_id].name , nand_flash_ids[i].name); |
2419 | 2420 | break; |
2420 | 2421 | } |
2421 | 2422 |
|
|
0 commit comments