diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2005-12-15 21:17:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-18 19:28:23 -0500 |
commit | 37b1cc3910f7976369fc0ed55068a686e92555e6 (patch) | |
tree | a4560bd6c25546e43d266a8b1f5f6f9d6d177421 /drivers/mtd | |
parent | ee219e5e7c12b742243a080e2d8d288a48a32e44 (diff) |
[PATCH] mtd onenand driver: check correct manufacturer
This (and the three subsequent patches) is working well on OMAP H4 with
2.6.15-rc4 kernel and passes the LTP fs test.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index f67d5d6eb9a6..33d6f5c2e053 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -1346,7 +1346,6 @@ static void onenand_print_device_info(int device) | |||
1346 | 1346 | ||
1347 | static const struct onenand_manufacturers onenand_manuf_ids[] = { | 1347 | static const struct onenand_manufacturers onenand_manuf_ids[] = { |
1348 | {ONENAND_MFR_SAMSUNG, "Samsung"}, | 1348 | {ONENAND_MFR_SAMSUNG, "Samsung"}, |
1349 | {ONENAND_MFR_UNKNOWN, "Unknown"} | ||
1350 | }; | 1349 | }; |
1351 | 1350 | ||
1352 | /** | 1351 | /** |
@@ -1357,17 +1356,22 @@ static const struct onenand_manufacturers onenand_manuf_ids[] = { | |||
1357 | */ | 1356 | */ |
1358 | static int onenand_check_maf(int manuf) | 1357 | static int onenand_check_maf(int manuf) |
1359 | { | 1358 | { |
1359 | int size = ARRAY_SIZE(onenand_manuf_ids); | ||
1360 | char *name; | ||
1360 | int i; | 1361 | int i; |
1361 | 1362 | ||
1362 | for (i = 0; onenand_manuf_ids[i].id; i++) { | 1363 | for (i = 0; i < size; i++) |
1363 | if (manuf == onenand_manuf_ids[i].id) | 1364 | if (manuf == onenand_manuf_ids[i].id) |
1364 | break; | 1365 | break; |
1365 | } | ||
1366 | 1366 | ||
1367 | printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", | 1367 | if (i < size) |
1368 | onenand_manuf_ids[i].name, manuf); | 1368 | name = onenand_manuf_ids[i].name; |
1369 | else | ||
1370 | name = "Unknown"; | ||
1371 | |||
1372 | printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf); | ||
1369 | 1373 | ||
1370 | return (i != ONENAND_MFR_UNKNOWN); | 1374 | return (i == size); |
1371 | } | 1375 | } |
1372 | 1376 | ||
1373 | /** | 1377 | /** |