mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
[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>
This commit is contained in:
parent
ee219e5e7c
commit
37b1cc3910
@ -1346,7 +1346,6 @@ static void onenand_print_device_info(int device)
|
||||
|
||||
static const struct onenand_manufacturers onenand_manuf_ids[] = {
|
||||
{ONENAND_MFR_SAMSUNG, "Samsung"},
|
||||
{ONENAND_MFR_UNKNOWN, "Unknown"}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1357,17 +1356,22 @@ static const struct onenand_manufacturers onenand_manuf_ids[] = {
|
||||
*/
|
||||
static int onenand_check_maf(int manuf)
|
||||
{
|
||||
int size = ARRAY_SIZE(onenand_manuf_ids);
|
||||
char *name;
|
||||
int i;
|
||||
|
||||
for (i = 0; onenand_manuf_ids[i].id; i++) {
|
||||
for (i = 0; i < size; i++)
|
||||
if (manuf == onenand_manuf_ids[i].id)
|
||||
break;
|
||||
}
|
||||
|
||||
printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n",
|
||||
onenand_manuf_ids[i].name, manuf);
|
||||
if (i < size)
|
||||
name = onenand_manuf_ids[i].name;
|
||||
else
|
||||
name = "Unknown";
|
||||
|
||||
return (i != ONENAND_MFR_UNKNOWN);
|
||||
printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf);
|
||||
|
||||
return (i == size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,7 +140,6 @@ struct onenand_chip {
|
||||
* OneNAND Flash Manufacturer ID Codes
|
||||
*/
|
||||
#define ONENAND_MFR_SAMSUNG 0xec
|
||||
#define ONENAND_MFR_UNKNOWN 0x00
|
||||
|
||||
/**
|
||||
* struct nand_manufacturers - NAND Flash Manufacturer ID Structure
|
||||
|
Loading…
Reference in New Issue
Block a user